Ruuvi Gateway Micropython

Hey all,

Created a sample application that should work on the Ruuvi Gateway when available.

I have tested it with an ESP32 and a nRF52 devkit.

The code can be found at:

2 Likes

Hey all,

Added a more advanced version that includes ana always on Web Server. Will add the ability to reset wifis settings and GW setting in the future. So far it is able to connect to create a WiFi hotspot, do a scan connect and configure the cloud connection.

There is more demand on the RAM so I needed to include mutliple modules into the FW so there is a bin file with all the modules included that are pressent in the frozen folder.

I’ll add the instructions shortly.

1 Like

I have been working on a remote, solar powered, battery backed project.
Concept: Pycom Gpy wakes up, reads ruuvi, connects LTE cellular and sends syslog packet for later analysis, simple. I’ve programmed on many platforms for over 40 years and am having a terrible time with both python and Pycom’s implementation.

  1. lte.attach() does not return a value and sometimes is successful and sometimes not. It seems that the only way to handle this is with a (limited range) loop which issues lte.isattached() and either sleeps briefly or continues.

  2. lte.disconnect is even worse as sometimes it does not even return at all. I will be enabling a watch dog timer to recover from those occurrence.

  3. Bugs in the version of the firmware I received caused me to update the firmware to a version released at the end of February. Since that update, attempting to develop in a wifi environment, the Gpy only transmits its SSID one time and my Mac can no longer connect. I ended up erasing and flashing a version 2 releases previous (since the the previous release also had this problem).

I know this is not the forum to discuss Pycom problems but I was hoping that with your experience you might offer some suggestions.

Hey,

I have not used a Gpy or a FiPy before so I might not be very helpful.

Are you using NB-IoT or CAT-M1?

Examples can be found at https://docs.pycom.io/tutorials/lte/ for both types.

1 Like

Thanks
As for the examples, they are more of the horrible non fault tolerant code with non-timeout loops!

Sorry I thought you were the guy with the Gpy experience.

Here is a good example:

:+1: thanks but also contains poor while(True):

I am successful using:

lte = LTE() # instantiate the LTE object (may fail!) # issue AT commands before attaching
for aa in range (1,14): # 4/06/20 from home saw 11 If fails connect will fail, syslog will fail,
pycom.rgbled(0x302020) # pink attaching disconnectwill fail, dettach will fail(hang?) deepsleep OK
lte.attach() # attach the cellular modem to a base station may fail
if lte.isattached() == True:
break
pycom.rgbled(0x000000) # blink
time.sleep(.1)

machine.deepsleep(275100) # 5*60 300,000

Sorry about the formatting.

Hey All,

Decided to split the two variations into their own repos.

The version without the always on web server can be found at:https://github.com/theBASTI0N/ruuvi.gateway.micropython

This version is able to be compiled into drop in replacement FW as it is only using python files and they can be added as frozen bytecode to a Micropython build.

The more feature rich version with an always on web server can be found at:https://github.com/theBASTI0N/ruuvi.gateway.micropython.webserver

This version requires files to be added once the FW image is flashed onto the board. This is because it is using .html files etc and I dont think these can be added to the firmware image.

Hey,

Release version 1.5.0.

If using MQTT configurations can be made via MQTT communication.

Also double press toggles the web interface on/off.