-
1Step 1
Installation
1. Install Arduino and following dependencies:
- https://github.com/arttupii/espNowFloodingMeshLibrary
- https://github.com/arttupii/ArduinoCommands
- https://github.com/arttupii/SimpleMqttLibrary
- https://github.com/kakopappa/arduino-esp8266-aes-lib (Only ESP2866)
2. Install esp8266 dev module. Use git version.
Instructions: https://github.com/esp8266/Arduino
3. Check Espressif FW version!!!. It should be nonos-sdk 2.2.1+100(testing).
4. Add "https://dl.espressif.com/dl/package_esp32_dev_index.json" into the Additional Board Manager URLs field.
5. Install esp32 dev module 1.0.3-rc1 from Arduino's Boards Manager.
6. Flash Usb adapter software (EspNowUsb/EspNowUsb.ino) on esp32/esp2866 (esp32 is the best choice.). (You don't need to change any parameters)
7. Install mqtt broker, nodejs and npm on RaspberryPi
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install mosquitto nodejs npm
8. Get gateway and install npm modules
git clone git@github.com:arttupii/EspNowFloodingMesh.git cd EspNowFloodingMesh cd gateway npm install
9, Modify gateway/config.js file:
- set secredKey parameter (16 bytes)
- set initializationVector parameter (16 bytes).
- set bsid
10. Start gateway software on RaspberryPi. .
a@labra:~/git/EspNowUsb/gateway/node index.js begin /dev/ttyUSB0 115200 Subscribe topic device1/led/value from cache Subscribe topic device1/led/set from cache reboot Role MASTER, ttl=3 MAC GET InitializationVector [178,75,242,247,122,197,236,12,94,31,77,193,174,70,94,117] key [0,17,34,51,68,85,102,119,136,153,170,187,204,221,238,255] Channel 1; Init RTC 1563876153
11. Open slave node code (arduinoSlaveNode/main/main.ino) and modify deviceName, secredKey, iv and ESP_NOW_CHANNEL paramaters.
- https://github.com/arttupii/EspNowFloodingMesh/tree/master/arduinoSlaveNode/main
- deviceName should be unique
- secredKey, iv, bsid and ESP_NOW_CHANNEL must be match to config.js file on raspberryPi. Otherwise mesh network won't work. --> Flash slave node
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.