Close

Temperature node initial setup - firmware/config side

A project log for Home environment monitor

Yet another wireless network of environmental sensors in a home

tundraTundra 03/10/2019 at 15:430 Comments

After assembling the hardware, it's time to get the firmware and configuration in place. 

Initial install of sketch is via USB upload from Arduino IDE:

  1. Plug the USB cable in, look on Arduino IDE for which port has been assigned (under Tools -> Port) and select that port
  2. Open serial monitor window
  3. Upload in Arduino IDE
  4. Hold down "Flash" button and tap "Reset" - keep "Flash" button held down until blue LED flashes and progress display in Arduino IDE shows the upload is in progress - can release "Flash" button then during upload. 
  5. After upload finishes, node will reboot itself. Do "tail -f /var/log/nginx/error.log". When the firmware checks for new sketch and spiffs, it will generate an error as the MAC address hasn't been associated with anything in the server side scripts. The error includes the MAC address - copy that to clipboard
  6. emacs /var/www/html/tempnode/sketch.php and add new entry in the initialization of the $db array for this MAC address pointing it to a specific sketch (for now I've got one sketch for temp nodes and one for the thermostat)
  7. emacs /var/www/html/tempnode/spiffs.php and add new entry in the initialization of the $db array for this MAC address pointing it to a specific configuration spiffs file. This file doesn't exist yet, next steps will define it.
  8. emacs /var/www/html/tempnode/spiffs/Makefile and a new macro for the base directory for this new node, add a new file section, add it to the all and version dependencies
  9. Copy ~/esp/home-env/tempnodes/data/office to ~/esp/home-env/tempnodes/data/newnode
  10. Within ~/esp/home-env/tempnodes/data/newnode edit the version.dat, node.txt, mquser.txt, mqpass.txt, mqhumtop.txt, mqpsitop.txt, mqtmptop.txt
  11. Now that the source directory for spiffs is configured, go to /var/www/html/tempnode/spiffs/ and do make
  12. Reboot new node to get it to load spiffs (the sketch will be the same version that was already uploaded) and confirm on OLED that the node name is picked up from spiffs configuration

Discussions