User Tools

Site Tools


users:dagnall53:node_programming

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
users:dagnall53:node_programming [2019/02/14 12:41] – [Programming the Hardware] dagnall53users:dagnall53:node_programming [2019/02/16 16:44] – [First Time Programming] dagnall53
Line 1: Line 1:
 Index   Index  
-  * [[https://github.com/dagnall53/ESPMQTTRocnetSound|ESP8266 Code]]+  * [[:users:Dagnall53:Description|Back to WiRocS Description]]  
 +  * [[https://github.com/dagnall53/WiRocS|Source Code]]
   * [[:users:Dagnall53:Node_Setup|Node_Setup]]    * [[:users:Dagnall53:Node_Setup|Node_Setup]] 
   * [[:users:Dagnall53:Hardware|Hardware]]    * [[:users:Dagnall53:Hardware|Hardware]] 
-  * [[:users:Dagnall53:RocClientThrottle|RocClientThrottle]] 
   * [[:users:Dagnall53:Troubleshooting|Troubleshooting]]   * [[:users:Dagnall53:Troubleshooting|Troubleshooting]]
-  * [[:users:Dagnall53:Node_programming|Node_Programming]] +  
 +====== Programming the Hardware ====== 
 + 
 +====== Arduino Libraries ====== 
 +===== Dependencies ===== 
 + 
 +It is vital that you have the correct libraries installed in your Arduino to allow it to compile the code. 
 +You should have    
 +  ESP8266 esp8266 by ESP8266 Community (I have Ver 2.4.2) 
 +  * ESP32  esp32 by Espresif System (I have version 1.01)  
 +  * Ftp support ESP8266FtpServer.h https://github.com/me-no-dev/arduino-esp32fs-plugin/releases/latest \\ 
 +  * ESP32Servo.h    https://github.com/madhephaestus/ESP32Servo/tree/master/src \\ 
 +  * PubSubClient.h https://github.com/ThingPulse/esp8266-oled-ssd1306 \\ 
 +  * SSD1306.h   https://github.com/ThingPulse/esp8266-oled-ssd1306  (You will need to use my [[https://github.com/dagnall53/Fonts-for-WiRocs/blob/master/OLEDDisplayFonts.h|Special Fonts]])\\ 
 +  * AudioOutputI2SNoDAC.h, AudioFileSourceSPIFFS.h, AudioGeneratorWAV.h, AudioOutputMixer.h see   https://github.com/earlephilhower/ESP8266Audio\\ 
 +   
 +   
 + 
  
  
-====== Programming the Hardware ====== 
  
 ===== First Time Programming ===== ===== First Time Programming =====
  
-If using the node as a "stationary" node, make sure that the Directive '#define _LOCO_SERVO_Driven_Port 1 ' is commented out +If using the node as a "stationary" node, make sure that the Directive '#define _LOCO_SERVO_Driven_Port 1 ' is commented out\\ 
-If using Audio, I would recommend the "NoDAC" option, which uses the single transistor drive shown in the illustrations. +If using Audio, I would recommend the "NoDAC" option, which uses the single transistor drive shown in the illustrations.\\ 
-Before programming or runnning the code, make sure you "UPLOAD" the "Sketch Data" to the ESP. This places all the WAV files in the ESP SPIFFS memory.  +Before programming or runnning the code, make sure you "UPLOAD" the "Sketch Data" to the ESP.\\( This places all the WAV files in the ESP SPIFFS memory. ready for playing sounds)\\  
-I program the ESP8266 with the Arduino 'NodeMCU 1.0 ESP12-E' board option, and it must be set to "Flash Size (4M,3M Spiffs)"+I program the ESP8266 with the Arduino 'NodeMCU 1.0 ESP12-E' board option, and it must be set to "Flash Size (4M,3M Spiffs)".\\ 
-For the ESP32, I use the 'WEMOS Lolin32' board option. +For the ESP32, I use the 'WEMOS Lolin32' board option.\\ 
  
 **Just to be "safe", I recommend that the first time you program you should also set:**  **Just to be "safe", I recommend that the first time you program you should also set:** 
Line 29: Line 46:
  
 ---- ----
 +===== Programming using OTA =====
 +The nodes can be updated using OTA (Over the Air) wireless programming.\
 +To do this you must know the node IP addres. Then, in Arduino, in "tools": port", select the node you wish to update.\\
 +Then proceed with Sketch:upload as you would if the node was connected physically.\\
 +
 +=== Known Limitation ===
 +I have noticed that the Node may need to be powered down and then re-powered after an OTA upload. \\
 +Because the MQTT find broker code blocks all other operations, the Node should be successfully connected to a MQTT broker before the update can be undertaken. Also note that, depending on what #defines you have used, after updating, you may still need to physically connect to the node to set SSID and Passwords etc. - But the update should not affect the saved values, so in general, if the code worked before you updated, it should do so again afterwards. 
 + 
 +
 +