|
|
||
|---|---|---|
| examples | ||
| src | ||
| .gitignore | ||
| keywords.txt | ||
| library.properties | ||
| LICENSE | ||
| README.md | ||
TLDR
- Install the Arduino IDE environment (or Visual Studio Code)
- And load the ESP32 board package (see any ESP32 tutorial)
- Then install the 'ACNode' software from the Library manager
- And select any of the 'examples' for the ACNode. A good start one is the 'Student test' one.
- Then select (depending on the hardware) the ESP32 WROOM-DA board and `Minimal SPIFFS' as the disk layout.
Each example is in fact the node as we have it in production.
Once you know this works - delete the ACNode package and replace it by any git copy.
Debugging
You can follow the serial port - but you can also HTTP or Telnet to the device its IP address (show on the screen as text or as a QR code) to get full remote control/debug information.
Full instructions
Install software environment for ACNode development
The instruction below is meant for a Windows 10 PC.
The following elements are part of the development environment:
- MQTT client (+ optional MQQT server/broker);
- Git server (code.makerspaceleiden.nl) and git client
- Arduino software
MQTT client and server
See for an overview of a number of clients: https://www.hivemq.com/blog/seven-best-mqtt-client-tools/
MQTT server/broker:
E.g. mosquitto:
Information: https://mosquitto.org/
Download: https://mosquitto.org/download/
This server/broker will be installed as a service on the Windows 10 PC.
Installation of Mosquitto server:
Download Mosquitto from https://mosquitto.org/download
Double click on the downloaded executable to install the Mosquitto service.
Install MQTT Clients:
- 1)MQTT.fx
Information: https://mqttfx.jensd.de/
Download ( 64 bit Windows): http://www.jensd.de/apps/mqttfx/1.7.1/mqttfx-1.7.1-windows-x64.exe
Download ( 32 bit Windows): http://www.jensd.de/apps/mqttfx/1.7.1/mqttfx-1.7.1-windows.exe
Double click on the downloaded executable to install this client.
Press Start and look in the list for MQTT.fx to start this program.
Installation of GIT:
Information: https://git-scm.com/
Download: https://git-scm.com/download/win
Git Client, Git-cola:
Informatie: https://git-cola.github.io
Download: https://github.com/git-cola/git-cola/releases/download/v3.5/git-cola-3.5.windows.zip
Unpack the downloaded ZIP file and double click dubbelklik the *.exe. Accept all windows message and install the software.
Arduino:
Information: https://www.arduino.cc/
Download: https://www.arduino.cc/download_handler.php
After de Arduino software is installed, Arduino must be configured before it can be used to develop software for the nodes of the Makerspace.
ESP32 board support:
Install in Arduino the software for the Olimex ESP32-PoE board:
See e.g. the instructions on: https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/
In short after starting the Arduino IDE software:
- In the menu of the Arduino software click File | Preferences
- In the Preference window shown add the following next to text: Additional Boards Manager URLs:
https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Option: Also enable Display line numbers
- Press the OK button
- In the menu of the Arduino software select Tools | Board: … and click on Boards Manager in the menu popping up. Scroll to the bottom in the list shown or add esp32 to the search input box, until you see esp32. Click the Install button for the esp32 and close the window as soon as the software is installed
- Select Tools | Board: … again but now scroll down in the list shown and select ESP32 WROOM DA
Install libraries needed:
Use the Library Manager (Menu: Tools | Manage Libraries… ) of the Arduino ontwikkel to install the following libraries:
- ** ACNode **
And give the Ok to also install the various dependencies from Adafruit and so on.
To speed up your search, add the name of the library, in the input box next to: Filter your search… Next press Install.
Tip: To edit certain source files it might be handy to use a plain text editor tool e.g. Notepad++.
Information: https://notepad-plus-plus.org/
Download: https://notepad-plus-plus.org/downloads/
Do the samen for the link https://github.com/rweather/arduinolibs.git, also unpack this ZIP file and go to the directory **…..\arduinolibs-master\libraries**. Copy the subdirectories Crypto and CryptoLegacy to the Windows directory Documenten\Arduino\libraries.
Open in the Arduino development software de SampleNode sketch:
Click left in the top of the Arduino window on the menu item File , then: Examples | ACNode | SampleNode
A new Arduino window is opened. with SampleNode sketch. Use File | Save As… to save this sketch as SampleNode.
The Arduino software is ready to compile the sketch and download it in the ESP32.
Tip: default the Serial monitor tool (Menu: Tools | Serial Monitor ) is configured with a baudrate of 9600, while the SampleNode sketch expects a baudrate of 115200. To do this you first have to connect the ESP32 to the PC and set the correct serial port (Menu: Tools | Port ).
Other notes
If needed - create a file such as
<your Arduino path>platform.local.txt
and include a statement such as
compiler.cpp.extra_flags=-imacros/Users/username/.local-config.h
compiler.c.extra_flags=-imacros/Users/username/.local-config.h
to include any #define's to override the default ones. E.g. for the WIFI and OTA passwords used.
An example for this .local-config.h file is shown below.:
#ifndef _H_LOCAL_CONFIG
#define _H_LOCAL_CONFIG
#warning "Settings for Makerspace network active !"
// Trick to take over Serial.print if needed.
#pragma weak panic_print_char
#define WIFI_NETWORK "XXXX"
#define WIFI_PASSWD "XXXX"
#define SYSLOG_HOST "192.168.1.2"
#define NTP_SERVER "192.168.1.1"
#define NTP_POOL NTP_SERVER ,"some.pool.ntp.org.xxxx"
// Output of 'echo -n password | openssl sha256':
#define OTA_PASSWD_HASH256 "ebd2f3fb12021751f2c86fb72c7af6551a8d290b84eba23dbbb0151ae76179be"
#define MQTT_HOST "192.168.1.4"
#define MQTT_TOPIC_PREFIX "testestest"
#define URL "https://192.168.1.3:4443/"
#define PAY_URL URL "pettycash/api"
#define ACL_URL URL "acl/api"
#define TERMINAL_URL URL "terminal/api"
#define SUMUP_URL URL "sumup/api/v1/sumup-pay"
#define UNKTAG_URL URL "api/v2/unknowntag"
#define RDN_DN_O "Makerspace Leiden Foundation"
#define RDN_DN_L "City"
Note that the wifi is only needed for Wifi nodes - it is ignored by PoE/wired nodes.