Albert Palomas

Electronics & Life Lover

Month: February 2019

LoRa – MySQL link using two Hope RFM69W and a Raspberry Pi

After looking for a already implemented solution for getting data from remote sensors, I decided to build my own solution, using existing components like Arduino, Raspberry Pi and especially I was interested on using the low cost RFM69W LoRa module.

My other target was to send the data to my own MySQL server instead of using third-party parterns like TTN.

And how it works? Basically it consist of two parts: sensors and gateway.

Sensor

It uses an Arduino Mini Pro 3.3V – 8MHz version as a processing core. It remains on deep-sleep mode, consuming less than 5 micro amperes and it wakes up every 10 minutes, sends data during few seconds, and sleep again. This strategy allows the sensor to be powered from 2 standard AA batteries and having an autonomy longer than a year.

Sensor powered from 2 AA batteries

The RFM69W module is connected to the Arduino using SPI and few control signals:

Arduino Mini PROLoRa RFM69W module
10 – SLAVE SELECTNNS
11 – MOSIMOSI
12 – MISOMISO
13 – SCKSCK
A0 – RESETRESET
2 – DIO0DIO0
7 – DIO1 (not used)DIO1
8 – DIO2 (not used)DIO2

It also contains a Adafruit Si7020 temerature & humidity sensor, connected via I2C to the Arduino (I removes and bridged transistors of this module to work at 3.3V)

Gateway

The gateway is mostly a Rasperry Pi connected to a RFM69 module using SPI and control signals This is the pinout:

Raspberry Pi (BCM numeration)LoRa RFM69 module
9 – MISOMISO
10 – MOSIMOSI
11 – SCKSCK
8NSS
25DIO0
22RESET
23EXTERNAL LED (not in module)

TODO: Write about software and firmware

idf.py build: too few arguments issue

Ok, if you got here, probably you got the same issue. After few hours trying to solve it, i finally found the solution.

The reason of this issue in my case is that I got a previous installation of python (platform.io has it’s own installer and I installed it before installing official esp-idf sdk).

The solution is to edit a pair of register keys, which are set from previous version of python and not updated by the new installation of python 2.7.14 in my case.

These are the keys you should edit (remember to make a backup before editing registers):

“HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command” and “HKEY_CLASSES_ROOT\Python.Files\shell\open\command ” Both sould have this same value: “C:\Python27\python.exe” “%1” %*

I hope you find it useful!


© 2024 Albert Palomas

Theme by Anders NorenUp ↑