It is not necessary for any esp8266 having a usb port as you program these directly via that usb port.
So. indeed: the nodemcu doesn't need it and neither does the Wemos.
The esp-07, also available, does need that setup to flash/program it.
It is not necessary for any esp8266 having a usb port as you program these directly via that usb port.
So. indeed: the nodemcu doesn't need it and neither does the Wemos.
The esp-07, also available, does need that setup to flash/program it.
I accidentally ran into this topic for a completely different reason. One of the posters mentioned that he had the same issues as you have due to an unstable power connector.
Another try?
In your Arduino software under "Tools" ("Hulpmiddelen" assuming you are using the Dutch version) you select the platform you flash for. In this case probably Nodemcu 0.9 or Nodemcu 1.0.
In that same menu you have "Flash size". In that submenu you can select 4M(3M SPIFFS) and 4M(1M SPIFFS). Default is the first one but in your case try the second one.
SPIFFS is SPI Flash File System. See here: https://nodemcu.readthedocs.io/en/master/en/spiffs/
@Petjepet
Please see this specific post on pimatic: https://forum.pimatic.org/topic/2234/external-selfmade-pimatic-max-thermostat-control-with-esp8266/17 for an EspEasy esp8266
This guy has the exact same crash and he set the spiffs-flash-size to 1M, and then it functioned.
@Petjepet - Sorry, I don't have a clue. It is simply working for me. I did quite some tries with different versions but either it worked or it didn't. I didn't see this error before. Are you sure you have connected the NRF24L01 correctly?
The mysensors 2.0 code works fine with pimatic, no matter whether you use the 2.0 MQTT Esp gateway via mosquitto (or another) as service in combination with the MQTT plugin, or via my mysensors 2.0 gateway with rest-api (also thanks to @Yveaux a.o.), mentioned in the other topic.
Yes, only that. It helped in my somewhat different situation with an unstable ESPEasy.
This may sound very stupid and might not help you at all, but I have a mixed set of 0.9 and 1.0 Nodemcu boards. I had some issues not related with mysensors, but with a 1.0 board flashed as 1.0 and used for ESPEasy (self compiled version).
Just as a test I recompiled for 0.9 (to my 1.0 board) and then it worked fine. Since then I compile/flash all my 0.9 and 1.0 Esps as 0.9.
no matter whether it is for EspEasy, "my" mysensors gateway with pimatic rest-API, or the standard mysensors esp8266 mqtt gateway.
I did not even check whether there are code differences or not between 0.9 and 1.0. For me 0.9 binaries work OK.
You gave the example of the relay actuator for the function but I took the esp8266 gateway to start with.
What I mean is that you see "in the top" the spi.h
and eeprom.h
declarations.
Then a number of #define
statements.
And just above the void setup()
the MySensors.h
and esp8266wifi.h
are declared.
I had some definitions that required the MySensors.h and those gave errors because they were declared below the "normal" position of the includes but above the "MySensors.h". (I even considered filing a bug ticket for the missing MySensors.h )
So I declared the MySensors.h in the top of the ino below spi.h and eeprom.h (because I had not seen the MySenors.h almost at the bottom of the ino).
And then some errors were fixed and a few other arose. It took me quite some time to see that the MySensors.h was declared sooo low in the ino where I definitely had not expected it.
@Yveaux : Thanks a lot! I have now a working version for mysensors 2.0.
It took me some time to understand the different sequence of includes, both in the top of the ino and just above the void setup()
. That took almost 2 hours before I suddenly realised that I had to change the sequence of some of my definitions and statements as well.
I'm used to include "everything" in the top of my code.
Hi,
Thanks for your fast response.
My code is in my github repo.
But actually it is this part of modified code in the void setup()
which was in the 1.5 version:
setupGateway(INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output);
// Initialize gateway at maximum PA level, channel 70 and callback for write operations
//gw.begin(incomingMessage, 0, true, 0);
gw.begin(incomingMessageESP, 0, true, 0);
"My" void incomingMessageESP(const MyMessage &message)
is simply using the incoming values and pushing it to pimatic's REST-api.
It used to be a simple hack of the gw.begin()
. I did check the examples but I'm not an experienced C-programmer. That's why I can't solve it.
I need to know where I can "hook" my function incomingMessageESP
into the new 2.0 code.
I tried in the void loop()
where it says // Send locally attached sensors data here
as I expected that it doesn't matter whether it is local sensors or local functionality but I simply don't get it.
As mentioned in the 2nd paragraph of the above first post: this spin-off for pimatic was based on a post of lendog.
lendog thanks @Hek, @Yveaux, and @nikil511 , so in hist post I do the same
And at the same time I ask assistance: "my" version for pimatic is also based on the 1.5 mysensors syntax and is based on a modified gw.begin. That has now disappeared. I'm a relatively experienced "code copier" but I'm stuck now.
2 questions:
I had some issues as well and read somewhere that there was an issue with the mosquitto packages for raspberri, so I installed from git.
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
for wheezy: sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
for jessie: sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
apt-get update
apt-get install mosquitto
sudo /etc/init.d/mosquitto start
All working flawless for months now.
This mysensors EspGateway2866 pushes sensor values directly to Pimatic via the REST-API.
You find it in my Esp8266GatewayPimatic repository. It currently only reads sensor values. It does not write sensor values back into the network. It is of course very limited compared to the GatewayESP8266MQTTClient but it is an extremely simple implementation not needing any plugins.
It is based on this post in the mysensors forum leading to this repository.
I combined a few things, stole a few things left and right (can't remember where; honestly) and came up with this new ino.
I included a Base64 library which is not be default included in the arduino package and which is definitely not the same as the base64 library inside the arduino library (note the Base64 vs. the base64). You need to copy this library into the libraries folder of your arduino setup, not in the mysensors setup.
Currently this ino receives sensor values from the mysensors network and pushes them as variables with their value to pimatic. Say you have a temperature sensor as node 2 child 0 with (temp) value 21.6. The variable pushed to pimatic will be "2-0", the value will of course be "21.6".
It is done in a mysensors 1.5 format as I have no idea how to do it in mysensors 2.0 format.
The default branch of my repository contains the mysensors 2.0 version. The other branch contains the previous mysensors 1.5 version.
The devices and variables section is identical to Esp8266gateway and pymysensors: another option/workaround
I also posted the pimatic extension to pymysensors thread but that was because I had not found the above mentioned thingspeak post at that time. I will not continue on that pymysensors one.
Please specify what doesn't work.
You have debug verbosity on which shows that your sensor on/of signal as such is recognized by pimatic.
Your used class is correct as well.
Did you specify the protocol in the mysensors plugin?
{
"plugin": "mysensors",
"driver": "serialport",
"protocols": "1.5.4",
"driverOptions": {
"serialDevice": "/dev/ttyUSB0",
"baudrate": 115200
}
},
The plugin still defaults to the 1.4 protocol.
Edit: Also check Getting started with MySensors in the pimatic forum.
I am using pimatic but due to the "configuration" of my house I need either (several) repeater nodes or do it via network/wifi as my raspberryPi is located in a different spot than most of my sensors and I have ethenet/wifi "everywhere".
The original pimatic-mysensors plugin (post "pimatic-mysensors controller plugin" in this sub forum) is very nice but has only a serial gateway. So I experimented with the ESP826Gateway and the new development branch GatewayEsp8266MQTTclientGateway (pimatic howto).
Then I stumbled onto pymysensors which I forked and extended with a currently extremely basic pimatic "read sensors, push to pimatic" extension via the Esp8266Gateway (pimatic forum post).
This post is not to "proudly present" but to "sincerely hope for more talented programmers to expand current functionality".
@martinhjelmare and @rollercontainer
There are days that I feel less intelligent.
That mygateway1-in
is indeed the reason and exactly as specified in the GatewayESP8266MQTTClient.ino sketch for incoming subscribe messages.
mosquitto_pub -t 'mygateway1-in/15/1/2/0/2' -m 0
and mosquitto_pub -t 'mygateway1-in/15/1/2/0/2' -m 1
does switch the relay off and on.
Thanks.
I'm using the Gatewayesp8266MQTTClient from the Development repository.
I'm reading 3 temperature sensors without problem.
I have now positioned a relay in my network using the default RelayActuator. I only set the node id manually to 15.
I'm using mosquitto on my RaspberryPi and view the messages with mosquitto_sub -v -t 'mygateway1-out/#'
When I start the node (on a arduino mini pro) I see the following in mosquitto
mygateway1-out/15/255/0/0/18 1.5.4
mygateway1-out/15/255/3/0/6 0
mygateway1-out/15/255/3/0/11 My Relay
mygateway1-out/15/255/3/0/12 1.0
mygateway1-out/15/1/0/0/3 (null)
mygateway1-out/15/255/0/0/18 1.5.4
mygateway1-out/15/255/3/0/6 0
mygateway1-out/15/255/3/0/11 My Relay
mygateway1-out/15/255/3/0/12 1.0
mygateway1-out/15/1/0/0/3 (null)
Edit (sorry, forgotten)
The serial output is:
read: 0-0-15 s=255,c=3,t=15,pt=0,l=2,sg=0:
repeater started, id=15, parent=0, distance=1
send: 15-15-0-0 s=255,c=3,t=11,pt=0,l=8,sg=0,st=ok:My Relay
send: 15-15-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
send: 15-15-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,st=ok:
From mosquitto I can give commands as well with mosquitto_pub
. Based on the example in https://www.mysensors.org/download/serial_api_15 (last line actually) I used the following commands to switch off/on
mosquitto_pub -t 'mygateway1-out/15/1/2/0/2' -m 0
and mosquitto_pub -t 'mygateway1-out/15/1/2/0/2' -m 1
This doesn't work. Unfortunately, not one single combination I try works. sensor=1? sensor=255?
What am I doing wrong?
I saw a commit to the DEV repo so I did a git pull
this morning, started arduino and recompiled and flashed.
It's working. Immediately!
The fixed ip-adress was there and the the serial monitor displayed nicely the debug and node messages.
The mosquitto broker receives the info which I can see using the mosquitto_sub
command.
It beats me, as I can't imagine the yesterday evening commit fixed it, but I'm glad it works.
For reference: This morning I used the 2.2.0 esp8266 board managers version.
Late reply (new forum user).
If not solved already then please downgrade your Esp8266 boards manager from 2.1.0 to 2.0.0.
(Preferences -> Additional board managers: http://arduino.esp8266.com/versions/2.0.0/package_esp8266com_index.json)
Hi,
I'm using the Arduino 1.6.5 ide on 64bit Linux using/trying the esp8266 2.2.0, 2.1.0 and 2.0.0 board mananger versions.
I used the mysensors DEV git branch of May 14th and compiled and flashed the GatewayESP8266MQTTClient.ino.
The only adaptions I made were the network settings for static IP and the broker address.
Compiling works fine and flashing to my Nodemcu 1.0 Devboard as well.
But absolutely nothing happens: I don't see anything on my serial monitor (I tried several baud rates). I can't ping it (static address 192.168.144.245). It doesn't connect to my mosquitto broker. Absolutely nothing.
So I took an identical Nodemcu and set it up: Again absolutely nothing.
The first nodemcu worked fine with the 1.5 branch Esp8266Gateway.ino. So I flashed the second nodemcu as well with this ino to rule out hardware issues: Both work fine.
I finally do a "sudo arp-scan --localnet" to check for the mac addresses on my network and now it turns out that it didn't get a static ip-adress, but a dhcp address being 192.168.144.13
However: still nothing on the serial monitor or at the mosquitto broker (and the broker functions fine. I tested that)
So I assume there is something wrong with the static ip settings in the DEV branch, but for the time being I can live with that.
For the record, these are my IP settings:
// Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
#define MY_IP_ADDRESS 192, 168, 144, 245
// If using static ip you need to define Gateway and Subnet address as well
#define MY_IP_GATEWAY_ADDRESS 192, 168, 144, 1
#define MY_IP_SUBNET_ADDRESS 255, 255, 255, 0
// MQTT broker ip address.
#define MY_CONTROLLER_IP_ADDRESS 192, 168, 144, 128
My issues are the complete abundance of serial output and the not connecting to my broker.
Can anyone please explain if I do something wrong? Or is this a straight bug in the DEV repository? (And I'm not talking about the static ip settings)