From b4e65aef6fc2410123c832a6b025075fb35b0dd5 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Mon, 27 Apr 2020 12:35:42 -0500 Subject: [PATCH] Arduino IDE library packaging modification #579 Update doc to reflect necessary manual changes Implement a part of these changes to automatic script --- docs/upload/arduino-ide.md | 14 +++++++++++++- scripts/prepare_deploy.sh | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/upload/arduino-ide.md b/docs/upload/arduino-ide.md index 03449ea..8fdd444 100644 --- a/docs/upload/arduino-ide.md +++ b/docs/upload/arduino-ide.md @@ -6,7 +6,18 @@ * Download OpenMQTTGateway code (OpenMQTTGateway_sources.zip) from the [release page](https://github.com/1technophile/OpenMQTTGateway/releases) and unzip it * Download the libraries package corresponding to your board and module wished into the same page (example esp32-m5stick-c-ble-libraries.zip) * Unzip the libraries into your arduino libraries folder (example D:/Users/XXXX/Documents/Arduino/libraries) -* Open the file main.ino from OpenMQTTGateway/main folder +* If you are using an ESP, Mega or other powerfull board; Open the *PubSubClient* folder, open the file src/PubSubClient.h, replace +```C++ +#define MQTT_MAX_PACKET_SIZE 128 +``` +by +```C++ +#define MQTT_MAX_PACKET_SIZE 1024 +``` +This modification will enable to send and receive by MQTT long json messages. + +* If necessary replace the spaces into each library folder by _: example rename “ESP32 BLE Arduino” folder to “ESP32_BLE_Arduino” +* Open the file main.ino from OpenMQTTGateway/main folder with the arduino IDE * Change the settings and the desired gateways into user_config.h (uncomment the modules you want) *Example for the use of RF gateway* @@ -21,6 +32,7 @@ * Change the pins or parameters corresponding to the modules choosen, for RF you can change the pins into config_RF.h * Choose the board on the Arduino IDE * Select the port corresponding to the board +* Note that for using BLE on ESP32 you will need to select *Minimal SPIFFS* into Tools->Partition Scheme * Open the serial monitor and set 115200 bauds * Upload ➡️ * You should see the logs into the serial monitor diff --git a/scripts/prepare_deploy.sh b/scripts/prepare_deploy.sh index 369af88..3f01b6f 100644 --- a/scripts/prepare_deploy.sh +++ b/scripts/prepare_deploy.sh @@ -3,6 +3,8 @@ rename -v 's:/:-:g' .pio/build/*/*.bin mkdir toDeploy rename 's/.pio-build-//' .*.bin cd .pio/libdeps +echo "replace space by _ in folder names" +find . -type d -name "* *" | while read FNAME; do mv "$FNAME" "${FNAME// /_}"; done echo "zipping libraries per board" for i in */; do zip -r "${i%/}-libraries.zip" "$i"; done ls -la