|
Post by computourist on Jun 10, 2016 18:16:10 GMT
You might try the decimal specifier: sprintf(buff_msg, "%0.2f", Vcc/1000); I tried, it just outputs: topic home/esp_gw/nb/node80/dev04 value:%.2f
Yes, I realised Arduino doesn't support that. You should use: dtostrf(vcc/1000, 10,2, buff_msg);
|
|
gaute
New Member
Posts: 34
|
Post by gaute on Jun 14, 2016 18:05:24 GMT
Hmm, it just ends up 3.00.. I think there is something wrong when I divide it by 1000. I removes the decimals..
Any idea what to do?
G
|
|
gaute
New Member
Posts: 34
|
Post by gaute on Jun 14, 2016 18:33:41 GMT
Solved it, I have to divide by 1000.00 to get two decimals... The pullrequest should be complete!
|
|
|
Post by computourist on Aug 4, 2016 10:33:45 GMT
|
|
|
Post by jimkernsjr on Sept 25, 2016 2:12:04 GMT
Hi Computourist...
I was able to mix this in with the RFM system, and it works well! A quick question - Is there a reason, or is it necessary that the MQTT messages are posted with the "RETAINED" flag?
The RFM system is not doing that. I kind of want to turn that off, unless you have a reason you did that. Additionally, is there an easy way to do it? I really didn't look through the code deep yet.
Thanks!
|
|
|
Post by computourist on Sept 26, 2016 8:24:33 GMT
Hi jimkernsjr, nice to hear all works well ;-) The retain flag is set in line 117: client.publish(topic.c_str(), String(topic_val).c_str(), true); Change it to: client.publish(topic.c_str(), String(topic_val).c_str()); to remove the retain flag. It has no purpose. I must have left it like this after experimenting with the will: a message left after disconnecting the node. The "will" message needs to be retained, but that is set in line 244.
|
|
|
Post by camblonie on Dec 6, 2016 2:56:26 GMT
I'd like to add DHT to the ESP but I cant figure out what i think is float to char conversion?
if (send49) { // send Humidity sprintf(buff_topic, "home/esp_gw/nb/node%02d/dev49", nodeId); hum = dht.readHumidity(); dtostrf(hum,0, 0, buff_msg); pubMQTT(buff_topic, buff_msg); send49 = false;
EDIT Solved my own issue. Posting a question ensures that my google skills improve for the next few minutes. Added dtostrf(hum,0, 0, buff_msg); above and define hum as float for anyone else doing the same.
|
|
|
Post by papa on Jun 15, 2017 21:04:19 GMT
|
|
|
Post by jimkernsjr on Jun 24, 2017 20:23:00 GMT
Hi Computourist and all...
I did a lot of changes to your ESP/Sonoff codes, including: -changed the AP mode to STA only, I didnt like all those AP's showing up in my network of devices. Seems like better securtiry too -added Over the Air updating. -Split my config out to header files-I dont like having many different code bases for each node, now I just uncomment the line for the device it's on and go... -added a device "toggle" for motion activated floodlights - the kind that require you to turn off and on the switch to lock them on.
Do you want to consider a merge or do you want me to just message it to you with a list of changes, or just post it? I'm not good with github, I posted things and struggled. I never took the time to learn it.
Think everyone will like the changes. Mainly the point was to put that into my windowshade node too, because this is hard to get apart to reprogram! I also have some lit artwork with the sonoffs hidden behind, and not easy to get out!!!
Best regards,
|
|
|
Post by papa on Jun 25, 2017 2:01:48 GMT
I'd love to see what you've done, jim. I just got a basic Sonoff & have been experimenting with it & the code. I've merged the ESP_DIG & ESP_Sonoff sketches & begun to create choice options as I did with the RFM69 nodes. I soon plan to do a detailed thread on getting started with ESP devices. Of course, it will use & expand on what computourist provided.
You & I could compare notes.
|
|
|
Post by jimkernsjr on Jun 25, 2017 5:29:12 GMT
I bought a Dual, a POW and a 4CH and some of the 4 relay variants too. I was wanting to integrate them all into it, but I wont have the time to do it anytime soon. I hate having 10 project files when I can have just one and multiple headers.
I just finished the OTA today, so let me install it tomorrow and make sure it's good and I publish it here. It's really been working flawlessly - I did the OTA type with the virtual com port instead of the http server type...
|
|
|
Post by computourist on Jun 25, 2017 19:59:29 GMT
Hello papa, jimkernsjr, Good to hear somebody picked up the code and improved. I have been busy with other projects & work so I have not looked at it for a long while. It would be nice if you could merge it on Github, so it becomes available to people that don't read this forum... Regards, Computourist
|
|
|
Post by jimkernsjr on Jun 26, 2017 0:52:57 GMT
Papa...
You know how to merge it on Github? I never took the time to learn it even so I have a Github page. I'm finished with it, I will post it on a new thread with documentation shortly...
|
|
|
Post by papa on Jun 26, 2017 2:02:41 GMT
Jim & computourist, I have only downloaded from Github, not uploaded, but it's about time I took that plunge. So jim, go ahead & post your code & documentation here (& be available for questions) & I'll work on the Github side. BTW, good to hear from both of you, jim & computourist. PS, computourist, are your "projects" related in any way to this forum's topics & might we hear about them when you get time?
|
|
|
Post by jimkernsjr on Jun 27, 2017 3:01:22 GMT
Hi All..
I started a new thread as you figured with this code in it.
Computourist...
Before you mentioned porting over the code base to the RFM95. Have you made any progress? I started on my side, but work is rough right now. I'd like to pick it back up. Basically my "progress" is an analysis.
I have something coming up where I use a 95 for another project. I was thinking of making it compatible and sort of combine the two, but only if it's worth the efforts.
Personally, I'm not a huge fan of the 69's...I never see much greater range than wifi. I think the people that do dont live in a brick house in a lot surrounded by trees.
|
|
|
Post by papa on Jun 27, 2017 13:08:04 GMT
Once I was successful connecting the RFM69 Gateway with an RFM69 Node, I've had great response with using the RFM69 radios. My gateway is on the top central level of my home as I've seen recommended to get the best coverage with WiFI routers. My home has only a brick veneer on the front of the main level. I have only two mature trees on opposite sides of the home. (So, jim, you may be right about RFM69 obstacles) As I describe in my thread on Automating Irrigation, some of my RFM69 nodes are in the raised garden beds in my yard. Those nodes at some distance are communicating very reliably. So I'm well satisfied with the RFM69 system & may well continue developing & documenting features for it. At the same time, I'm interested in extending the ESP8266 possibilities as well as encouraging other methods like you mention, jim.
|
|
|
Post by jimkernsjr on Jun 27, 2017 22:52:08 GMT
Dont get me wrong, I do like the RFM69. I think I prefer it for battery nodes, as wifi is hungry and it's easier to sleep and wake the Arduino it seems. It's just me personally I dont get the range everyone else brags about. I am reetching a circuit board for the battery powered nodes to put back in my mailbox. I've improved the code I ported a bit from Eric's origional design to work with Computourist's format, as it's the most efficient yet according to my checks. I also created an "IOT Button" with the ESP-03 module and 2 AA batteries, and one of those stick up lights from the dollar store. For under $5 in parts it's perfect for things like this. Here is where I got the idea, but only to use the button: benlo.com/esp8266/esp8266Projects.htmlI didn't like to have to hold it down, use LUA (yuck), and dynamic hotspot and dynamic ip is a terrible idea for such a thing (takes too long to initialize before the button triggers). If anyone wants, I'll try to post, I did the schematics in EasyEDA. It's my own code though, and has nothing to do with OTA or anything here. But it makes a great button to slap on the way out the door!
|
|