diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e05db73e64ed324bc7497c3158ed097dcb828f7c..329c547e7df6a4134baf53892310cbad3b2b4f15 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,12 +22,13 @@ build: - arduino-cli core update-index --config-file arduino-cli.yaml - arduino-cli core install esp32:esp32 - # Add pyserial for esp32 to chooch + # Add pyserial for esp32 tools to chooch - pip3 install pyserial # Install dependencies - arduino-cli lib install Ethernet - - arduino-cli lib install --git-url https://github.com/patricklaf/SNMP.git --config-file arduino-cli.yaml + - arduino-cli lib install SNMP@1.4.0 + - arduino-cli lib install MCP23S08@0.5.2 # Set version, tag if available else commit sha - ICBM_GIT_VERSION=$CI_COMMIT_SHORT_SHA diff --git a/README.md b/README.md index 8b904d3588660b4a197980a43de129b8ff08dfd8..23b1300104e2a9c11057a185ddb73809f7bbf333 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ -# IMC Arduino Firmware +# ICBM Arduino Firmware -ESP32 firmware for the IMC, based on Arduino and the `ESP32-Ethernet-Kit_A_V1.2`. +ESP32 firmware for the ICBM, based on Arduino and the `ESP32-Ethernet-Kit_A_V1.2`. +The Intelligent Controller Board for MPODs is a project that aims to automatically +perform power procedures upon defined inputs. -This project depends on [`Arduino_SNMP`](https://github.com/patricklaf/SNMP). + +This project depends on [`Arduino_SNMP`](https://github.com/patricklaf/SNMP) and [`MCP23S08`](https://github.com/RobTillaart/MCP23S08). ## Usage The IMC is meant to be used over network using HTTP get and post. @@ -18,7 +21,8 @@ It can be queried as a heartbeat, seeing the uptime increasing. ### Serial Interface The serial interface is available through the micro-usb port. -It prints basic networking information, as well as a heartbeat (`-` if ethernet is disconnected, else `.`). +It prints basic networking information, as well as a heartbeat (`-` if ethernet is disconnected, else `.`). +It is not possible to control the device or perform queries through the serial interface. ## Development @@ -62,10 +66,11 @@ Update the Arduino index with: arduino-cli core update-index -The required libraries are: +The required libraries are (minimum versions): arduino-cli lib install ethernet - arduino-cli lib install --git-url https://github.com/patricklaf/SNMP.git + arduino-cli lib install SNMP@1.4.0 + arduino-cli lib install MCP23S08@0.5.2 The project can be compiled so: diff --git a/rest.cpp b/rest.cpp index d1d2efb2ed0752d9c71c50c33f53b4e30ea590e0..8760bbab419d520a52d909cb5163a54ea759f05c 100644 --- a/rest.cpp +++ b/rest.cpp @@ -52,6 +52,16 @@ void identify() { message += seconds; message += "\""; + // TODO: Add here mcp23s08 info: + // Pin status; + // Interrupt status; + // seconds since last interrupt. + // + // TODO: Add here power sequence status + // is_ramping_down + // current step + // percentage + message += "\n}"; restServer.send(200, "text/json", message); @@ -104,6 +114,7 @@ void sendSNMP() { } auto ipAddr = IPAddress(192,168,140,79); + if (output != NONE) { SNMP::Message *snmp_msg = mpod.output(output); snmp.send(snmp_msg, ipAddr, SNMP::PORT::SNMP); delete snmp_msg;