Good morning, very nice feature for Tasmota. Very powerfull.
Using my code on arduino MEGA2560 works like a charm, but with arduino UNO i get: "Tasmota Slave Version 29 not supported!". Using any example from your library also works with UNO, so, I think, may be the problem is in my code. I am using another library (https://github.com/FatBeard/vbus-arduino-library). To get data from solar controller this library use a hardware serial in MEGA2560 but, with UNO use Altofserial.
The funny thing is that, in UNO, even with the error, I get in Tasmosta Console the correct read values from solar controller, but data is not published via MQTT. This is the Console in UNO:
00:00:00 CFG: Loaded from flash at F7, Count 181
00:00:00 Project tasmota Tasmota Version 8.2.0(tasmota)-STAGE
00:00:00 WIF: Connecting to AP1 Tomato24 in mode 11N as tasmota_4CCA08-2568...
00:00:07 WIF: Connected
00:00:07 HTP: Web server active on tasmota_4CCA08-2568 with IP address 192.168.130.78
09:14:17 MQT: Attempting connection...
09:14:17 MQT: Connected
09:14:17 MQT: tele/tasmota_4CCA08/LWT = Online (retained)
09:14:17 MQT: cmnd/tasmota_4CCA08/POWER =
09:14:17 MQT: tele/tasmota_4CCA08/INFO1 = {"Module":"Generic","Version":"8.2.0(tasmota)","FallbackTopic":"cmnd/DVES_4CCA08_fb/","GroupTopic":"cmnd/tasmotas/"}
09:14:17 MQT: tele/tasmota_4CCA08/INFO2 = {"WebServerMode":"Admin","Hostname":"tasmota_4CCA08-2568","IPAddress":"192.168.130.78"}
09:14:17 MQT: tele/tasmota_4CCA08/INFO3 = {"RestartReason":"External System"}
09:14:18 Tasmota Slave Enabled
09:14:21 MQT: tele/tasmota_4CCA08/STATE = {"Time":"2020-04-17T09:14:21","Uptime":"0T00:00:14","UptimeSec":14,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":30,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Tomato24","BSSId":"B0:6E:BF:B2:7F:A0","Channel":1,"RSSI":34,"Signal":-83,"LinkCount":1,"Downtime":"0T00:00:08"}}
09:14:21 Tasmota Slave Version 29 not supported!
09:14:24 CMD: ***
09:14:24 CMD: Collector Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Top Tank Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Bottom Tank Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Flow in Temp: 0.00
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Water Pump Status: 0
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Water Pump Speed: 0
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Pump Hours Operation: 15
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:24 CMD: Backup Heater Hours Operation: 0
09:14:24 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: System Alert Status: 1
09:14:25 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: Scheme: 1
09:14:25 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: System Time: 00:0
09:14:25 MQT: stat/tasmota_4CCA08/RESULT = {"Command":"Unknown"}
09:14:25 CMD: *** End Read ***
And this is my code:
#include <VBUSDecoder.h>
VBUSDecoder vb;
#include <Arduino.h>
#include <TasmotaSlave.h>
TasmotaSlave slave(&Serial);
long lastTimevbus = 0;
long intervalvbus = 15000;
#define DEBUG 1
void setup() {
Serial.begin(115200); // Configure the Serial port for the correct baud rate
vb.initialise();
}
void loop() {
slave.loop(); // Call the slave loop function every so often to process incoming requests
vb.readSensor(); // Read the data from Vbus-UART in Serial1
if (millis() - lastTimevbus > intervalvbus) {
lastTimevbus = millis();
char buffer[40];
int S1Temp = vb.getS1Temp();
int S2Temp = vb.getS2Temp();
int S3Temp = vb.getS3Temp();
int S4Temp = vb.getS4Temp();
char SystemTime[5];
vb.getSystemTime().toCharArray(SystemTime, 6);
int P1 = vb.getP1OperatingHours();
int P2 = vb.getP2OperatingHours();
sprintf(buffer, "{%02d,%02d,%02d,%02d,%s,%02d,%02d}", S1Temp, S2Temp, S3Temp,
S4Temp,SystemTime,P1, P2);
slave.SendTele(buffer);
#if DEBUG
Serial.println("");
Serial.println("*** Fresh Read ");
Serial.print("Collector Temp: ");
Serial.println(vb.getS1Temp());
Serial.print("Top Tank Temp: ");
Serial.println(vb.getS3Temp());
Serial.print("Bottom Tank Temp: ");
Serial.println(vb.getS2Temp());
Serial.print("Flow in Temp: ");
Serial.println(vb.getS4Temp());
Serial.print("Water Pump Status: ");
Serial.println(vb.getP1Status());
Serial.print("Water Pump Speed: ");
Serial.println(vb.getP1Speed());
Serial.print("Pump Hours Operation: ");
Serial.println(vb.getP1OperatingHours());
Serial.print("Backup Heater Hours Operation: ");
Serial.println(vb.getP2OperatingHours());
Serial.print("System Alert Status: ");
Serial.println(vb.getAlertStatus());
Serial.print("Scheme: ");
Serial.println(vb.getScheme());
Serial.print("System Time: ");
Serial.println(vb.getSystemTime());
Serial.println(" End Read ***");
#endif
}
}
The Tasmota Console with MEGA2560:
00:00:00 CFG: Loaded from flash at F9, Count 718
00:00:00 Project tasmota Tasmota Version 8.2.0(tasmota)-STAGE
00:00:00 WIF: Connecting to AP1 Tomato24 in mode 11N as tasmota_01A69E-1694...
00:00:07 WIF: Connected
00:00:07 HTP: Web server active on tasmota_01A69E-1694 with IP address 192.168.130.245
09:35:29 MQT: Attempting connection...
09:35:29 MQT: Connected
09:35:29 MQT: tele/tasmota_01A69E/LWT = Online (retained)
09:35:29 MQT: cmnd/tasmota_01A69E/POWER =
09:35:29 MQT: tele/tasmota_01A69E/INFO1 = {"Module":"Generic","Version":"8.2.0(tasmota)","FallbackTopic":"cmnd/DVES_01A69E_fb/","GroupTopic":"cmnd/tasmotas/"}
09:35:29 MQT: tele/tasmota_01A69E/INFO2 = {"WebServerMode":"Admin","Hostname":"tasmota_01A69E-1694","IPAddress":"192.168.130.245"}
09:35:29 MQT: tele/tasmota_01A69E/INFO3 = {"RestartReason":"Power On"}
09:35:30 SNS: Hardware Serial
09:35:30 Tasmota Slave Enabled
09:35:32 Tasmota Slave Version 20191129
09:35:33 MQT: tele/tasmota_01A69E/STATE = {"Time":"2020-04-17T09:35:33","Uptime":"0T00:00:14","UptimeSec":14,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":22,"MqttCount":1,"Wifi":{"AP":1,"SSId":"Tomato24","BSSId":"B0:6E:BF:B2:7F:A0","Channel":1,"RSSI":58,"Signal":-71,"LinkCount":1,"Downtime":"0T00:00:08"}}
09:35:33 MQT: domoticz/in = {"idx":503,"nvalue":0,"svalue":"0;14.0","Battery":100,"RSSI":5}
09:35:33 MQT: domoticz/in = {"idx":508,"nvalue":0,"svalue":"16.0","Battery":100,"RSSI":5}
09:35:33 MQT: tele/tasmota_01A69E/SENSOR = {"Time":"2020-04-17T09:35:33","ENERGY":{"TotalStartTime":"2020-04-11T14:35:16","Total":0.014,"Yesterday":0.007,"Today":0.000,"Period":0,"Power":[0,0],"ApparentPower":[0,0],"ReactivePower":[0,0],"Factor":[0.00,0.00],"Voltage":[0,0],"Current":[0.000,0.000]},"DS18B20":{"Id":"011452EE49AA","Temperature":16.0},"TempUnit":"C"}
09:36:22 MQT: tele/tasmota_01A69E/RESULT = {"TasmotaSlave":{26,24,40,30,09:35,720,39}}
With MEGA2560 works very well, and I get the sting with the solar controller data published via MQTT.
I dont know if would possible to solve my problem with arduino UNO.
Kind regards.