Edge Collective

Inexpensive Heltec WiFi + LoRa Gateway Setup

Notes on setting up a Heltec device.

Arduino IDE Setup

Board Manager URL for ESP32:

https://dl.espressif.com/dl/package_esp32_index.json

Board Manager URL for Feather M0 LoRa:

https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

Guides

Robotzero

Basically need to just load this config file in 'Additional Board Manager URLs' field in Preferences in Arduino IDE:

https://dl.espressif.com/dl/package_esp32_index.json

Then can select Heltec WiFi Lora (V2) (the board we're using).

WiFi scan worked.

wifi scan
Initial wifi scan test.

Display Library

U8g2 library for Arduino covers a wide range of common displays.

Test code that will scan wifi and display the results on the screen.

Main Heltec Documentation

Heltec Wifi Lora 32

Coding and Setup Debugging ...

Instructable that has a nice set of diagrams of pinouts

Heltec Library

Main github reference for Heltec devices -- includes KiCad file for device

Heltec WiFi LoRa send / receive

Heltec syncword issue

Robot Zero One LoRa receiver demo

They suggest using this LoRa library.

Working LoRa Example

Follow Robot Zero One LoRa receiver demo;

use this LoRa library;

And this example.

Receive and display. Can get it posted on the display using this example with U8g2 display library -- basically works.

Radiohead Example

Basic RFM95 Receive code for Heltec. Works.

Low Power sleep

Discussion of entering low power sleep mode

HTTP GET AND POST

Tutorial here.

Working code to do basic JSON post to FarmOS here.

ArduinoJSON SerializeJSON documentation.

HTTP JSON POST TO FARMOS

Using loop-updated variables, code is here.

HELTEC WIFI LORA POST TO FARMOS

Using dummy variables, not yet parsing incoming radio, code is here

Github Repo

Feather sends JSON data; Heltec receives, parses, posts to FarmOS; code is here.

1-wire temp sensor on remote

Tutorial

Sleep Modes for ESP32

Some nice notes here

Deep sleep example code

Able to get about 2 mA in deep sleep using Heltec. ...

.. then turned off lora radio and got 1 mA.

gist of the code to do this is here

Further discussion of low power modes here.

ESP32 Data logging

Nice tutorial here

Single-channel gateway guides

Using ESP8266

From Sparkfun

Appcodelabs using MQTT

From CNX Software -- looks like they use dozens of nodes here.

Heltec Deep Sleep

Thread here.

Heltec OTA updates

Lastminuteengineer description using Arduino IDE is here.

Using the web, here.

Espressif github example of web-based OTA here.

Modified example worked nicely, code is here

Login page:

Initial login page to ESP32.

And it works!

Progress after uploading.

General Heltec guides

Great guide to Heltec, here

Config Portal setup for wifi on ESP32

WiFi Manager library here

I think the relevant section is here

Nice guide for Config Portal here

Nice set of utilities around AutoConnect and etc for ESP32 by 'hieromon', here

Maybe this, by 'Hieromon' is the latest lib <---- yes, this is it!!

Getting started page here <---- Great place to start with autoconnect.

Working Autoconfig code

This is the code that I took from that link just above, and I put it here And it worked!

Easiest to install AutoConnect via ArduinoIDE -- it then prompts for other necessary libraries.

Can use AutoConnect 'Credential' example to erase currently-saved WiFi credentials.

Embedding autoconfig

How to embed Autoconnect, here.