Advertisement
lovejoy777

AgonLight2_wifi_nodemcu

Feb 1st, 2024 (edited)
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ZXBasic 5.51 KB | Software | 0 0
  1. Pastebin Link: https://pastebin.com/7HX7ZAtX
  2. # Written by lovejoy777 1/2/24
  3. I'm using Linux with conda python manager with python version 3.11.
  4.  
  5. # Using an esp-8266 nodemcu v3 board as a wifi adapter for the Agon Light2 (olimex version).
  6.  
  7. Link: esp8266 sdk from the Olimex ESP8266EX-how-to-update-firmware.pdf
  8. https://www.olimex.com/Products/IoT/_resources/esp8266_nonos_sdk_v1.5.1_16_01_08_0.rar
  9.  
  10. # Note:1
  11. The binary files you want from the above link, copy TO ~/Desktop/firm/ (see below).
  12. boot_v1.5.bin (found in the /bin/ folder).
  13. user1.2048.new.5.bin (found in the /bin/AT/1024+1024/ folder).
  14. user2.2048.new.5.bin (found in the /bin/AT/1024+1024/ folder).
  15. blank.bin (same file used twice), (found in the /bin/ folder).
  16. esp_init_data_default.bin (found in the /bin/ folder).
  17.  
  18. Activate python version (I use conda TO manage my python versions. I used python 3.11).
  19. $ conda activate py311
  20.  
  21. Install esptool, (esptool.py v4.7.0 AT time of writing)
  22. $ pip install esptool
  23.  
  24. Make a directory TO put your firmware binary's in (& download and copy binary's into it).
  25. $ mkdir ~/Desktop/firm
  26. See Note:1 above.
  27.  
  28. FLASH files with below CODE 1 file AT a time, make sure your nodemcu resets between flashes.
  29. Without conda I think the normal location FOR the esptool is .local/lib/pythonx.xx/site-packages/esptool.py.
  30. /dev/ttyUSB0 is my com port, change it TO what ever com port your nodemcu is connected TO.
  31. Take a note of the Address's for each .bin file to be flashed to.
  32.  
  33. FLASH boot_v1.5.bin.
  34. $ ~/anaconda3/bin/esptool.py -p /dev/ttyUSB0 write_flash -fm dio -fs 4MB 0x00000 ~/Desktop/firm/boot_v1.5.bin
  35.  
  36. FLASH user1.2048.new.5.bin.
  37. $ ~/anaconda3/bin/esptool.py -p /dev/ttyUSB0 write_flash -fm dio -fs 4MB 0x01000 ~/Desktop/firm/user1.2048.new.5.bin
  38.  
  39. FLASH user2.2048.new.5.bin.
  40. $ ~/anaconda3/bin/esptool.py -p /dev/ttyUSB0 write_flash -fm dio -fs 4MB 0x81000 ~/Desktop/firm/user2.2048.new.5.bin
  41.  
  42. FLASH blank.bin.
  43. $ ~/anaconda3/bin/esptool.py -p /dev/ttyUSB0 write_flash -fm dio -fs 4MB 0x1FE000 ~/Desktop/firm/blank.bin
  44.  
  45. FLASH esp_init_data_default.bin.
  46. $ ~/anaconda3/bin/esptool.py -p /dev/ttyUSB0 write_flash -fm dio -fs 4MB 0x1FC000 ~/Desktop/firm/esp_init_data_default.bin
  47.  
  48. FLASH blank.bin.
  49. $ ~/anaconda3/bin/esptool.py -p /dev/ttyUSB0 write_flash -fm dio -fs 4MB 0x1FE000 ~/Desktop/firm/blank.bin
  50.  
  51. # Note:2
  52. I wanted TO make sure every FLASH went well so I disconnected my nodemcu AND reconnected it in-between each FLASH.
  53. The nodemcu v3 can be powered by either 5v OR 3v3 on the vin pin.
  54. ** Warning ** DO NOT power the nodemcu by the micro usb whilst its connected TO your Agon, LET the Agon power it with 3v3.
  55.  
  56. # Wiring:
  57. UEXT pin 1 (3v3) TO nodemcu vin pin.
  58. UEXT pin 2 (gnd) TO nodemcu grd pin.
  59. UEXT pin 3 (TX ) TO nodemcu RX pin.
  60. UEXT pin 4 (RX ) TO nodemcu TX pin.
  61.  
  62.   LOOKING INTO UEXT PORT
  63.    ------       ------
  64.   | 9 | 7 | 5 | 3 | 1 |
  65.   |-------------------|
  66.   | 10| 8 | 6 | 4 | 2 |
  67.    -------------------
  68.  
  69. After installing firmware on your nodemcu AND connecting it up TO your Agon Light2 It's time to set it up and get online.
  70. Head TO nihirash's github (link below) and grab the following files.
  71.  
  72. esp-at-tester/bin/tester.bin
  73. snail/bin/snail.bin
  74. * esp-update/bin/esp-update.bin (I updated mine manually with AT commands from the tester.bin program so unsure IF this works).
  75. * netman didn't work for me so not sure if you want this one.
  76. Link: nihirash's github.
  77. https://github.com/nihirash/Agon-MOS-Tools/tree/main/esp8266
  78.  
  79. create a folder on your Agons sdcard /internet AND place snail.bin & tester.bin inside.
  80. Insert the sdcard into your Agon AND power on.
  81. From the mos prompt (*) LOAD /internet/tester.bin
  82. hopefully you will get a series of OK statements appear. (IF NOT make sure your Agon RX goes TO nodemcu TX etc).
  83.  
  84. Following the instructions on the snail browser github readme from the above link DO the following.
  85. enter the following lines of CODE one AT a time pressing enter after each.
  86. AT+CWMODE=1                                                       (Set esp TO mode 1).
  87. AT+CWJAP="your_wifi_ssid_here","your_wifi_password_here"          (Set your wifi creds).
  88. AT+CIFSR                                                          (Connect TO wifi network).
  89. AT+GMR                                                            (Check version info).
  90. AT+CIUPDATE                                                       (Update with ota).
  91. AT+GMR                                                            (Check version info,  should now be 1.7.5.0 OR above).
  92.  
  93. # Note3:
  94. I tried using it after the above steps AND it didn't work, I then did the following.
  95. AT+RST                                                            (Resets wifi module).
  96. AT+RESTORE                                                        (Restores back TO factory settings).
  97. AT+CWMODE=1                                                       (Set esp TO mode 1).
  98. AT+CWJAP="your_wifi_ssid_here","your_wifi_password_here"          (Set your wifi creds).
  99. AT+CIFSR                                                          (Connect TO wifi network).
  100. BYE                                                               (Exits tester program).
  101.  
  102. Reboot Agon (probably NOT needed but why NOT).
  103.  
  104. From the mos prompt (*).
  105. LOAD /internet/snail.bin
  106. Enjoy....
  107.  
  108. I take no responsibility IF you see the magic smoke, please be careful when connecting things TO the Agons ports.
  109.  
  110. Other useful AT commands.
  111. AT+CWJAP?                                                        (Returns wifi creds).
  112. AT+CWMODE?                                                       (Returns wifi mode).
  113.  
Tags: AgonLight2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement