Closed Bodobolero closed 11 months ago
@Bodobolero I don't think so, no, let me test that firmware and make sure it's working, will get back to you later today.
I saved your script as main.py, and loaded the firmware attached here, https://github.com/arduino/arduino-iot-cloud-py/issues/72#issuecomment-1787270297
Seems to work normally, I don't see that error you posted. Note I removed the DHT part and used the internal sensor like you did. I also made sure UART REPL is working. Maybe you have a boot.py
in that's getting in the way ? You should remove it if you do.
I ordered a USB to serial bridge which I expect to be delivered on Nov, 2nd. Then I can start debugging.
@iabdalkader I have received and tested my USB-2-TTL Adapter and have connected it to the microcontroller. I verified that I can open a terminal (minicom on macOS) and see the output, for example:
socket_ioctl(56, 3)
17:38:20.000 DHT20: 21.78382 C
17:38:20.000 Update: temperature value: 21.78382 ts: 1698946700
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
socket_ioctl(56, 3)
17:38:21.000 Pushing records to Arduino IoT cloud:
17:38:21.000 ==> record: temperature value: 21.78382...
socket_send(56, 31)
socket_polling_rw(56, 5000, 2)
I am now waiting for the failure scenario to debug it.
@iabdalkader so far no outage with the new debug firmware. Maybe the timing is different due to more debug output - or the problem is not deterministic. I will keep running the microcontroller until it fails.
If you'd like to test another firmware with less debugging output just let me know.
@iabdalkader it is still running. Now I wonder if the debug firmware 'MicroPython v1.22.0-preview.69.gc146017f8.dirty on 2023-10-31;'
already contained some fixes that are not yet released in the upstream Micropython firmware I used before and also not in the prior firmware version 'MicroPython v1.22.0-preview.51.g91a3f1839.dirty on 2023-10-23; Arduino Nano RP2040 Connect with RP2040'
?
No all of the firmware images attached here have the same fixes. I don't know which upstream firmware you used before, but the nightly/preview builds (Not the stable one) should have the fixes by now (and more fixes will follow).
If you want to retest an image with no debugging output, this one should do:
This one also doesn't have debugging output enabled, but enables REPL over UART.
This one also doesn't have debugging output enabled, but enables REPL over UART.
@iabdalkader the firmware with debugging output and REPL over UART never failed and kept running. I have now deployed this version with debugging output disabled but REPL over UART to see if it still fails without debugging output enabled.
@iabdalkader Since I cannot reproduce the problem with the current script and the latest firmware you provided I close this issue for now, until I have a reliable repro. Thanks for your support.
That's great! Feel free to reopen this issue if it ever gets stuck again.
I am running the following script on Arduino RP2040 Connect with Arduino IoT Cloud. The script reads temperature and humidity from DHT20 over I2C using https://files.seeedstudio.com/wiki/Grove-Temperature-Humidity-Sensor/Pico-micropython-master.zip dht20.py.
The script runs fine for about 12 hours (about 40.000 loop iterations) and then gets stuck. I suspect this is due to heap fragmentation in ArduinoIoTCloud python module or other module it uses.
It would be helpful to add a watchdog like in the C implementation that reboots the board in case of becoming unresponsive.
Here is my script to repro the problem
Maybe the problem is in my script and not in the arduino-iot-cloud-py implementation - however so far I did not succeed in deploying a Arduino IoT cloud project in production in Micropython while I have several Arduino IoT cloud "things" successfully deployed already using the Arduino Cloud C/C++ libraries.