Posted on

This article describes part of a project called Solar Powered Garage

In the last update of the project page I shared my thoughts on how devices communicate with users. I mentioned that after considering a few options (including screen + buttons and Bluetooth) I decided I would like to try connecting to my solar controller with LoRa. Due to the fact I don't have any gateway within a reasonable distance of my garage, I have to host it on my own. I wanted to make an experiment to confirm that the signal from the garage can reach the place where I will host a gateway.

Range

In theory, LoRa range can be up to 10 km, but the reality is harsher. Buildings, trees and other electromagnetic signals - these are aspects that can drastically lower the distance over which the signal can be transmitted without loss. Distance from my home to the garage is 320 meters in a straight line. I thought it should work, but I wanted to be sure that my investment in a gateway will not be useless for this project.

Testing range

I picked two Lora E5 mini boards. These boards have very easy-to-use firmware that is controlled via UART with AT commands. There is a testing mode that allows us to transmit and receive bare messages with LoRa. I used that to test signal coverage. To have more fun I attached one of the LoRa E5 mini boards to Flipper using Flipper's prototype board. The second board was connected to my PC at home. Then I wrote two applications (I could use two computers and one application, but I wanted to finally write some application for Flipper Zero). Home side's application was written in Rust and was transmitting AT commands to the UART port. Flipper's application is also based on UART connection to E5. Home part of the application was so fun for me that I later extended the application to enable Lua scripting, so now Lua script describes what commands we send to the LoRa E5 mini board.

Testing scenario was easy:

  1. On the sending side (at home), the application initializes a counter to zero and increases it after each frame.
  2. Each frame contains the date, time and counter.
  3. The application sends a frame every few seconds.
  4. On the receiver side, the application shows the date and time of the last received frame, the number of missed frames, and the counter state.

Results

As you can see, results were not bad. In the second video, I restarted the application, but in the first one, it was working continuously since I left my flat. Most frames were lost when I was walking behind buildings. Frankly speaking, the same buildings are on the way between the garage and my flat, but it seems that the signal reaches that place. What's more, I'm going to install the LoRa gateway on the balcony and put the antenna a bit higher. In my test, the antenna was near the window, but it was inside the building, so it was an additional obstacle.

I think LoRa is suitable at least for telemetry, so I'm going to continue this approach.

Work on telemetry will be a parallel project. Currently I'm using a Victron controller for my PV, which has a UART port transmitting some stats (it is called VE.Direct), so I have a great occasion to test this solution before implementing support for it in Fugu controller.

Access to the source code

If you are interested in source code of my solutions, please contact me. We can discuss your access to repositories.