This software is the code for an ESP-32 MCU that will work as an edge node in a network used to monitor energy consumption.
This node has also the capability of Modbus comunication as a Slave and Master RTU serial.
In additon, comunication with a LoRa device is also available.
Each task can be enabled separately, so his node can be used as master or slave, can have connected the LoRa or not, and can other modules can be added
The task does not communicate directly to echa other, they only share the same resource, which is memory.
- Holding registers hold the node specific settings
- Input register holds the energy measure.
- Settings can done through Modbus
1.Clone the repository:
git clone https://gitlab.com/electr-nica/desarrollohardware/edge-node.git
2.Open the project in the terminal and build the menuconfig:
make menuconfig
3.Navigate to custom configuration and select with the key y what modules do you what to enable as well as the baudarate and serial port if apply. Then save and close.
- Build the project:
make all
- Flash the MCU:
make flash
- Enjoy!
If you use eclipse as IDE, after you properly installed esp-idf and the tool chanin of xtensa you just need a few steps to fully set up your project.
-
Open your project in a workspace.
-
Go to properties in your project folder, then go to environment in the C/C++ Built. Change the paths to match with your paths.
-
Clean and Build. Make sure you made
make menuconfig
in your project through the terminal. -
Enjoy!
This software is the code for an ESP-32 MCU that will work as an edge node in a network used to monitor energy consumption.
-
Clone the repo
git clone https://gitlab.com/electr-nica/desarrollohardware/edge-node
-
Go to the project folder
cd edge-node
-
Build menuconfig
make menuconfig
-
Go to Serial Flash Cofig and set your serial port to flash
-
Go to Custom Config to choose the mode and parameters of the RTU
-
Go to __Serial Flasher Options __ and set the Flash size to at least 4MB.
-
Finally, go to Partition Table and select __Custom Partition Table __ and set the file partitions.csv
Make sure you have selected HARDWARE (TEST) in the menuconfig
to flash the code into devboards.
```c
#define TXD_PIN 33
#define RXD_PIN 26
#define RTS_PIN 27
#define CTS_PIN 19
```
```c
#define TXD_PIN 13
#define RXD_PIN 15
```