Replies: 18 comments 2 replies
-
how is it wired? how is the esp8266 powered? what serial baud rate? did you try to turn on debug log? |
Beta Was this translation helpful? Give feedback.
-
The esp8266 is embedded. It is part of the Mega 2560 R3 board: [https://arduinotech.dk/shop/mega-r3wifi-atmega328pesp8266-32mb-memory-usb-ttl-ch340g-compatible-for-arduino-mega-nodemcu-esp8266/] I know about the serial baud rate for the monitor and the communication between the Mega 2560 and the esp8266 but don't know the baud rate of the esp8266/WiFi. How could I know that? I haven't tried to turn on the debug log. How do I do that? Thanks for the help. I am new to Arduino/embedded programming. |
Beta Was this translation helpful? Give feedback.
-
Found logging level here :) src/utils/EspAtDrvLogging.h |
Beta Was this translation helpful? Give feedback.
-
This is a typical example where first attempts fails, second works: 21:56:25.813 -> node_id: Node1
21:56:25.813 -> temperature_am2320: 26.80
21:56:39.085 -> esp> OK ...matched
21:56:39.247 -> esp> AT+CIPSEND=4,335 ...sent
21:56:54.393 ->
21:56:54.491 -> esp> AT+CWJAP? ...sent
21:56:54.751 -> esp> 4,CONNECT ...ignored
21:56:54.880 -> esp> AT+CIPSEND=4,335 ...sent
21:56:57.885 -> esp INFO: sent 335 bytes on link 4
21:57:00.105 -> esp> 4,CLOSED ...processed
21:57:01.183 -> {"message": ":Weather log added recently within the same span of time. Record will be skipped for node id Node1 and timestamp: 1667598971"} |
Beta Was this translation helpful? Give feedback.
-
how did you upload the AT firmware? I usually see this strange behavior if the wifi calibration data of the esp are corrupted |
Beta Was this translation helpful? Give feedback.
-
I used this command: esptool.py --port /dev/cu.usbserial-144230 write_flash --flash_mode dio --flash_size 1MB 0x0 boot_v1.7.bin 0x01000 at/512+512/user1.1024.new.2.bin 0xfb000 blank.bin 0xfc000 esp_init_data_default_v08.bin 0xfe000 blank.bin 0x7e000 blank.bin I updated it to the latest version you suggested on a link I found in an Arduino forum. How could I verify that and calibrate the esp? |
Beta Was this translation helpful? Give feedback.
-
During last night the transmission has been quite acceptable just a few retries and every 15 minutes as expected. But sometimes I am unable to see a record in hours. { |
Beta Was this translation helpful? Give feedback.
-
this is the upload command for a 1 MB flash. the README for WiFiEspAT has the command for larger flash. |
Beta Was this translation helpful? Give feedback.
-
It seems more stable after the update you suggested. Let's test it for a few hours and let's see how it behaves. What is the difference? |
Beta Was this translation helpful? Give feedback.
-
It seems to fails still but with a little improvement. At least it seems that is not missing data after a few retries. Let's leave it until tomorrow to get a better sample of data.
|
Beta Was this translation helpful? Give feedback.
-
There have been a few retries during the night and only one record missing out of 29. Unfortunately I could not see the logs for the missing record. My computer got stuck yesterday in the evening apparently .. :( Is it possible to improve it with any other adjustments? |
Beta Was this translation helpful? Give feedback.
-
Ok I will disable logging also for a while to see how it goes. I have also removed all delays and all String. I am using F() for the literals. How can I remove this String? is the only one left:
|
Beta Was this translation helpful? Give feedback.
-
logging slows down everything so there can be some loss of data on the Serial to esp8266. |
Beta Was this translation helpful? Give feedback.
-
Seems more estable now. Sometimes it requires a few retries but it is much better than before. Thank you Juraj. I will try to replace the String concatenation with char array. |
Beta Was this translation helpful? Give feedback.
-
I have managed to move from String to char arrays the last two Strings I was using in the code. Hope that also prevent any memory leaks. Thanks for the help @JAndrassy. I will check out the difference between both flash commands. |
Beta Was this translation helpful? Give feedback.
-
I can see now my ESP as a WiFi Access Point by default. How could I prevent that? |
Beta Was this translation helpful? Give feedback.
-
@JAndrassy it is getting better by time. It is the ESP auto calibrating itself somehow? |
Beta Was this translation helpful? Give feedback.
-
esp8266 does calibration on reset. not always. |
Beta Was this translation helpful? Give feedback.
-
Hi
I am writing with the hope somebody can give me a hand.
Several request get a 400 'bad request' or 406 'not acceptable' code in return from the web server. Some other times there is not even a response from the server. It seems the connection dies before it reaches the server, since I cannot see any logs on the server console.
Retrying the same request sometimes work.
I have an Arduino Mega 2560 R3 + WiFi Esp8266 with firmware 1.7 (Non OS SDK3).
What could be the issue?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions