If you want to use library functions outside the main sketch, you can also just include the core header, e.g.
#include "core/MySensorsCore.h"
If you want to use library functions outside the main sketch, you can also just include the core header, e.g.
#include "core/MySensorsCore.h"
If you use an ISP programmer, you can reprogram the fuses and use it on lower voltages also. Upto 1.8v but also 3.3v
I haven't tested it, but this one seems to fit what you need
https://github.com/mycontroller-org/serial2mqtt/blob/master/README.adoc
@skywatch said in Auto resend on NACK:
@electrik & @Marek - Are you both sure about that? It seems to me that both those statements are doing what was intended.
Now that I see it again, I'm not so sure anymore actually.
In your code you used the variable msg. That should be one of msgFgeHum, msgFgeTemp, msgFzrHum, msgFzrTemp.
That is why the compiler complains msg is unknown.
You also enabled the ack message, this is just a software acknowledge, while the send function returns the status of the hardware acknowledge. So if you check with
if (send(msgFgeHum.set(fgehum),true))
{
// this is sent ok
}
else
{
// sending failed
}
you check if the hardware acknowledge was successful. The software ack should be tested differently and some more logic is needed for it.
Hope this helps
You should move the define for the node ID before you include mysensors.h
Exactly. Better to ask then waste many hours 😏
You can remove these lines, the declaration is already done in the MySensors framework. For presentation() it is needed because you write code there, that is in the function. Now you only call the function, and the code is already in the framework.
I am using the Pinchange interrupts to wake up from sleeping.
Maybe this helps?
See code snippets below.
#include <PinChangeInt.h> //include PinChange lib from MySensors utilities
in setup()
attachPinChangeInterrupt(BotLeft_PIN, BotLeft_ISR, CHANGE);
and in the ISR
void BotLeft_ISR() {
_wokeUpByInterrupt = 0xFE; // work-around to force MS lib to handle this interrupt
// more code here
}
There are many examples...
https://forum.mysensors.org/topic/3764/p1-smart-meter-nta8130-readout-using-mysensors/7
Or on GitHub, needs some tinkering to integrate in mysensors
https://github.com/search?l=C%2B%2B&q=P1+meter&type=Repositories
Edit
There is also a library available
https://github.com/matthijskooijman/arduino-dsmr
@skywatch still if you use wait(), the rest of the code in the loop is not executed during the waiting time. Only the mysensors core is executed
You should do the same for requestTime();
Hello
I've tried to use this with an ESP32 (I modified some defines for the architecture, to make it compatible). In MyHwESP32.h I've changed
#define MY_SERIALDEVICE Serial
to
#ifndef MY_SERIALDEVICE
#define MY_SERIALDEVICE Serial
#endif
I think this why it doesn't work for you @ricorico94 with version 2.3 of MySensors.
It worked sometimes, but usually Putty responds "Network error: Connection refused"
Any ideas?
MY_DISABLED_SERIAL wil output nothing on the serial, no matter software or hardware serial. So in your case you don't need to define it.
And try removing the semicolon after
#define MY_DEBUGDEVICE mySerial;
@mfalkvidd said in Strange behavior on MQTT Gateway Reset:
MySensors does set the retain message on I_BATTERY_LEVEL messages (but no other messages)
If the define MY_MQTT_CLIENT_PUBLISH_RETAIN is used, all messages are retained. But that is not active by default, so probably not used in this case. Just to be complete ;-)
You can also try to use esp32 board definition v1.0.0. I guess you are now using 1.0.1
@linkinpio in the pubsubclient library, you can change the timeout on connecting to the mqtt broker. Default it is 15s, reducing it to e.g. 2s will increase the availability of the main loop.
Here the picture of the assembled board. The top board is a temperature sensor so not necessarily needed.
