Skip to content

Commit

Permalink
add cmd Queue for mqtt and cc1101 #5
Browse files Browse the repository at this point in the history
  • Loading branch information
dewenni committed Dec 21, 2024
1 parent 66faacd commit e1a3dea
Show file tree
Hide file tree
Showing 20 changed files with 200 additions and 83 deletions.
8 changes: 6 additions & 2 deletions changeNew.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# v1.x.x
# v1.2.0

## what's new

this is a minor bug fix version!
Implemented a command queue for incomming mqtt messages and also for the CC1101 commands.
Commands are now buffered and processed sequentially to prevent timing issues during transmission.

this project is still in an early phase.
If you like this project, feel free to push the **[Star ⭐️]** button and click **[Watch 👁]** to stay updated.
Expand All @@ -12,3 +13,6 @@ If you have any further questions, suggestions or requests, please use the discu
## changelog

- fix missing SW-Version in MQTT-SysInfo and Home Assistant
- Implemented a command queue for incoming mqtt messages. #5
- Implemented a command queue for CC1101 to handle rapid consecutive commands to prevent timing issues during transmission. #5
- update to Arduino core 3.1.0 based on IDF 5.3.2.241210
2 changes: 1 addition & 1 deletion include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*-------------------------------------------------------------------------------
General Configuration
--------------------------------------------------------------------------------*/
#define VERSION "v1.1.1" // internal program version
#define VERSION "v1.2.0" // internal program version

#define WIFI_RECONNECT 30000 // Delay between wifi reconnection tries
#define MQTT_RECONNECT 10000 // Delay between mqtt reconnection tries
Expand Down
2 changes: 1 addition & 1 deletion include/gzip_css.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/gzip_js.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/gzip_login_html.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const uint8_t PROGMEM gzip_login_html[] = {0x1f, 0x8b, 0x08, 0x00, 0x3f, 0x00, 0x63, 0x67, 0x02, 0xff, 0x75, 0x53, 0xb1, 0x92, 0xd4, 0x30, 0x0c, 0xed, 0xef, 0x2b, 0x84, 0x5b, 0xc8, 0xe6, 0x38, 0x1a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x55, 0xf8, 0x76, 0xca, 0x7f, 0x7a, 0x68, 0x06, 0x66, 0x67, 0xe7, 0xc2, 0x71, 0x68, 0x7a, 0x9d, 0xa6, 0x9e, 0xbd, 0xca, 0xdc, 0xc6, 0xb0, 0x72, 0x72, 0xec, 0xef, 0x32, 0xca, 0xab, 0x6d, 0x54, 0x65, 0x5e, 0x58, 0x5e, 0x68, 0xde, 0x63, 0xda, 0xc5, 0xe5, 0xbb, 0xfd, 0x01, 0x84, 0x40, 0xe8, 0x4e, 0x7f, 0x03, 0x00, 0x00};
const uint8_t PROGMEM gzip_login_html[] = {0x1f, 0x8b, 0x08, 0x00, 0xdc, 0x7a, 0x66, 0x67, 0x02, 0xff, 0x75, 0x53, 0xb1, 0x92, 0xd4, 0x30, 0x0c, 0xed, 0xef, 0x2b, 0x84, 0x5b, 0xc8, 0xe6, 0x38, 0x1a, 0x8a, 0x64, 0x1b, 0xb8, 0x2b, 0x18, 0x66, 0xd8, 0x19, 0x8e, 0x82, 0x52, 0x89, 0xb5, 0xb1, 0xe7, 0x1c, 0xdb, 0xd8, 0xca, 0xee, 0x85, 0xaf, 0xc7, 0x59, 0x27, 0x24, 0x3b, 0x2c, 0x95, 0xe5, 0xf7, 0xe4, 0x27, 0xe9, 0x69, 0x5c, 0xbd, 0xf9, 0xfc, 0xed, 0xd3, 0xf3, 0xcf, 0xc3, 0x23, 0x28, 0xee, 0xcd, 0xfe, 0xae, 0x9a, 0x0e, 0x30, 0x68, 0xbb, 0x5a, 0x90, 0x15, 0x20, 0x75, 0xa8, 0x85, 0xe1, 0x90, 0x22, 0x64, 0x2c, 0x58, 0x51, 0x4f, 0xb5, 0x90, 0x18, 0x5e, 0xc4, 0xfe, 0x0e, 0xa0, 0x52, 0x84, 0x72, 0x0a, 0x52, 0xd8, 0x13, 0x23, 0xb4, 0x0a, 0x43, 0x24, 0xae, 0xc5, 0x8f, 0xe7, 0xa7, 0xe2, 0xa3, 0x80, 0x72, 0x4b, 0x5a, 0x9c, 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0x21, 0x8c, 0x04, 0x5f, 0x5d, 0xa7, 0x6d, 0x55, 0xfa, 0x0d, 0x77, 0x74, 0xa1, 0x07, 0x6c, 0x59, 0x3b, 0x9b, 0x3c, 0x34, 0x53, 0x82, 0x80, 0x34, 0x96, 0x72, 0xb2, 0x16, 0xde, 0x45, 0x16, 0x6b, 0x72, 0x4a, 0xd7, 0xd6, 0x0f, 0xbc, 0xb1, 0x47, 0xcc, 0xd3, 0x0f, 0x91, 0xc2, 0x14, 0x09, 0xf0, 0x06, 0x5b, 0x52, 0xce, 0x48, 0x0a, 0x19, 0x86, 0x8c, 0x07, 0xfa, 0x35, 0xe8, 0x40, 0x72, 0xf1, 0x6e, 0x2b, 0xb8, 0x01, 0x60, 0x16, 0xf7, 0x18, 0xe3, 0xd9, 0x05, 0x29, 0xae, 0xb8, 0x5c, 0xec, 0x36, 0x77, 0x55, 0xf8, 0x76, 0xca, 0x7f, 0x7a, 0x68, 0x06, 0x66, 0x67, 0xe7, 0xc2, 0x71, 0x68, 0x7a, 0x9d, 0xa6, 0x9e, 0xbd, 0xca, 0xdc, 0xc6, 0xb0, 0x72, 0x72, 0xec, 0xef, 0x32, 0xca, 0xab, 0x6d, 0x54, 0x65, 0x5e, 0x58, 0x5e, 0x68, 0xde, 0x63, 0xda, 0xc5, 0xe5, 0xbb, 0xfd, 0x01, 0x84, 0x40, 0xe8, 0x4e, 0x7f, 0x03, 0x00, 0x00};
const unsigned int gzip_login_html_size = 448;
2 changes: 1 addition & 1 deletion include/gzip_m_html.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/gzip_ntp_html.h

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions include/jarolift.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#pragma once

void jaroCmdUp(uint8_t channel);
void jaroCmdDown(uint8_t channel);
void jaroCmdStop(uint8_t channel);
void jaroCmdSetShade(uint8_t channel);
void jaroCmdShade(uint8_t channel);
void jaroCmdLearn(uint8_t channel);
void jaroCmdSetDevCnt(uint16_t value);
void jaroCmdReInit();
bool getCC1101State();
Expand All @@ -14,3 +8,12 @@ uint16_t jaroGetDevCnt();

void jaroliftSetup();
void jaroliftCyclic();

enum JaroCommandType { CMD_UP, CMD_DOWN, CMD_STOP, CMD_SET_SHADE, CMD_SHADE, CMD_LEARN };

struct JaroCommand {
JaroCommandType type;
uint8_t channel;
};

void jaroCmd(JaroCommandType type, uint8_t channel);
5 changes: 0 additions & 5 deletions include/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
#include <config.h>
#include <language.h>

struct MqttMessage {
String topic;
String payload;
};

/* P R O T O T Y P E S ********************************************************/
const char *addTopic(const char *suffix);
void mqttSetup();
Expand Down
12 changes: 6 additions & 6 deletions lib/JaroliftController/JaroliftController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void JaroliftController::devcnt_handler(boolean do_increment) {
devcnt++;
EEPROM.put(cntadr, devcnt);
EEPROM.commit();
sendMsg(ESP_LOG_INFO, "Device Counter: %i", devcnt);
sendMsg(ESP_LOG_DEBUG, "Device Counter: %i", devcnt);
} // void devcnt_handler

// ####################################################################
Expand Down Expand Up @@ -136,7 +136,7 @@ bool JaroliftController::getCC1101State(void) { return cc1101.connected(); }
// ####################################################################
uint32_t JaroliftController::cmd_get_serial(int channel) {
uint32_t serial = (config.serial << 8) + channel;
sendMsg(ESP_LOG_DEBUG, "get serial: 0x%08x for channel: %i", serial, channel);
sendMsg(ESP_LOG_DEBUG, "get serial: 0x%08x for channel: %i", serial, channel + 1);
return serial;
}

Expand Down Expand Up @@ -428,7 +428,7 @@ void JaroliftController::cmdStop(uint8_t channel) {
radio_tx(2);
enterrx();
rx_function = 0x4;
sendMsg(ESP_LOG_INFO, "command STOP for channel %i sent", channel);
sendMsg(ESP_LOG_INFO, "command STOP for channel %i sent", channel + 1);
devcnt_handler(true);
} // void jaroCmdStop

Expand Down Expand Up @@ -486,7 +486,7 @@ void JaroliftController::cmdSetShade(uint8_t channel) {
delay(300);
}
rx_function = 0x6;
sendMsg(ESP_LOG_INFO, "command SET SHADE for channel %i sent", channel);
sendMsg(ESP_LOG_INFO, "command SET SHADE for channel %i sent", channel + 1);
devcnt_handler(false);
delay(2000); // Safety time to prevent accidentally erase of end-points.
} // void cmd_set_shade_position
Expand All @@ -501,7 +501,7 @@ void JaroliftController::cmdLearn(uint8_t channel) {
return;
}

sendMsg(ESP_LOG_INFO, "putting channel %i into learn mode ...", channel);
sendMsg(ESP_LOG_INFO, "putting channel %i into learn mode ...", channel + 1);
new_serial = cmd_get_serial(channel);
EEPROM.get(cntadr, devcnt);
sendMsg(ESP_LOG_DEBUG, "Device Counter from EEPROM: %i", devcnt);
Expand Down Expand Up @@ -553,7 +553,7 @@ void JaroliftController::cmdUpDown(uint8_t channel) {
radio_tx(1);
enterrx();
devcnt_handler(true);
sendMsg(ESP_LOG_INFO, "command UPDOWN for channel %i sent", channel);
sendMsg(ESP_LOG_INFO, "command UPDOWN for channel %i sent", channel + 1);
} // void cmd_updown

void JaroliftController::begin() {
Expand Down
12 changes: 6 additions & 6 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[env:esp32]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.10/platform-espressif32.zip
board = upesy_wroom
board_flash_size = 4MB
framework = arduino
Expand Down Expand Up @@ -31,25 +31,25 @@ extra_scripts =
; ----------------------------------------------------------------
;upload_port = /dev/cu.usbserial-0258166D
;upload_port = /dev/cu.usbserial-576D0483281
upload_port = /dev/cu.usbserial-576D0481591
;upload_port = /dev/cu.usbserial-576D0481591
;upload_port = /dev/cu.usbserial-0001
;upload_port = /dev/cu.usbmodem01


; ----------------------------------------------------------------
; OPTION 2: wireless OTA Update
; ----------------------------------------------------------------
;upload_protocol = espota
;upload_speed = 115000
;upload_port = 192.168.178.199 ; Conneted to Router
upload_protocol = espota
upload_speed = 115000
upload_port = 192.168.178.30 ; Conneted to Router
;upload_port = 192.168.4.1 ; Setup Mode (ESP create Accesspoint)


lib_compat_mode = strict
lib_ldf_mode = chain
lib_deps =
mathieucarbou/AsyncTCP @ 3.3.1
mathieucarbou/ESPAsyncWebServer @ 3.4.3
mathieucarbou/ESPAsyncWebServer @ 3.4.5
bblanchon/ArduinoJson @ 7.2.0
lib_ignore =
;LittleFS_esp32
Binary file removed release/esp32_jarolift_controller_flash_v1.1.1.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
119 changes: 100 additions & 19 deletions src/jarolift.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
#include <JaroliftController.h>
#include <basics.h>
#include <config.h>
#include <jarolift.h>
#include <mqtt.h>
#include <queue>

#define MAX_CMD 20
#define SEND_CYCLE 500

static muTimer cmdTimer = muTimer();
static const char *TAG = "JARO"; // LOG TAG
std::queue<JaroCommand> jaroCmdQueue;

JaroliftController jarolift;

/**
* *******************************************************************
* @brief message callback for JaroliftController
* @param level,msg
* @return none
* *******************************************************************/
void msgCallback(esp_log_level_t level, const char *msg) {
switch (level) {
case ESP_LOG_ERROR:
Expand All @@ -26,6 +40,27 @@ void msgCallback(esp_log_level_t level, const char *msg) {
}
}

/**
* *******************************************************************
* @brief add jarolift command to buffer
* @param type, channel
* @return none
* *******************************************************************/
void jaroCmd(JaroCommandType type, uint8_t channel) {
if (jaroCmdQueue.size() < MAX_CMD) {
jaroCmdQueue.push({type, channel});
MY_LOGD(TAG, "add cmd to buffer: %i, %i", type, channel + 1);
} else {
MY_LOGE(TAG, "to many commands within to short time");
}
}

/**
* *******************************************************************
* @brief Jarolift Setup function
* @param none
* @return none
* *******************************************************************/
void jaroliftSetup() {

// initialize
Expand All @@ -45,6 +80,12 @@ void jaroliftSetup() {
MY_LOGI(TAG, "read Device Counter from EEPROM: %i", jarolift.getDeviceCounter());
}

/**
* *******************************************************************
* @brief send expected position via mqtt
* @param channel, position
* @return none
* *******************************************************************/
void mqttSendPosition(uint8_t channel, uint8_t position) {
char topic[64];
char pos[16];
Expand All @@ -60,28 +101,68 @@ void mqttSendPosition(uint8_t channel, uint8_t position) {
}
}

void jaroCmdUp(uint8_t channel) {
jarolift.cmdUp(channel);
mqttSendPosition(channel, 0);
};

void jaroCmdDown(uint8_t channel) {
jarolift.cmdDown(channel);
mqttSendPosition(channel, 100);
};
void jaroCmdStop(uint8_t channel) { jarolift.cmdStop(channel); };

void jaroCmdShade(uint8_t channel) {
jarolift.cmdShade(channel);
mqttSendPosition(channel, 90);
};

void jaroCmdReInit() { jaroliftSetup(); };
void jaroCmdSetShade(uint8_t channel) { jarolift.cmdSetShade(channel); };
void jaroCmdLearn(uint8_t channel) { jarolift.cmdLearn(channel); };
void jaroCmdSetDevCnt(uint16_t value) { jarolift.setDeviceCounter(value); };
uint16_t jaroGetDevCnt() { return jarolift.getDeviceCounter(); };
bool getCC1101State() { return jarolift.getCC1101State(); };
uint8_t getCC1101Rssi() { return jarolift.getRssi(); }

void jaroliftCyclic() { jarolift.loop(); }
/**
* *******************************************************************
* @brief execute jarolift commands from buffer
* @param type, channel
* @return none
* *******************************************************************/
void processJaroCommands() {
if (!jaroCmdQueue.empty()) {

JaroCommand cmd = jaroCmdQueue.front();

switch (cmd.type) {
case CMD_UP:
jarolift.cmdUp(cmd.channel);
mqttSendPosition(cmd.channel, 0);
MY_LOGI(TAG, "execute cmd: UP - channel: %i", cmd.channel + 1);
break;
case CMD_DOWN:
jarolift.cmdDown(cmd.channel);
mqttSendPosition(cmd.channel, 100);
MY_LOGI(TAG, "execute cmd: DOWN - channel: %i", cmd.channel + 1);
break;
case CMD_STOP:
jarolift.cmdStop(cmd.channel);
MY_LOGI(TAG, "execute cmd: STOP - channel: %i", cmd.channel + 1);
break;
case CMD_SET_SHADE:
jarolift.cmdSetShade(cmd.channel);
mqttSendPosition(cmd.channel, 90);
MY_LOGI(TAG, "execute cmd: SETSHADE - channel: %i", cmd.channel + 1);
break;
case CMD_SHADE:
jarolift.cmdShade(cmd.channel);
MY_LOGI(TAG, "execute cmd: SHADE - channel: %i", cmd.channel + 1);
break;
case CMD_LEARN:
jarolift.cmdLearn(cmd.channel);
MY_LOGI(TAG, "execute cmd: LEARN - channel: %i", cmd.channel + 1);
break;
}

jaroCmdQueue.pop();
}
}

/**
* *******************************************************************
* @brief jarolift cyclic function
* @param none
* @return none
* *******************************************************************/
void jaroliftCyclic() {

if (cmdTimer.cycleTrigger(SEND_CYCLE)) {
processJaroCommands();
}

jarolift.loop();
}
Loading

0 comments on commit e1a3dea

Please sign in to comment.