These are chat archives for esp8266/Arduino

18th
Jun 2018
Chris Dalby
@moose4621
Jun 18 2018 05:54
@denman0000_gitlab I finished up modifying this for the ping pong or heart beat monitor. http://django-websocket-redis.readthedocs.io/en/latest/heartbeats.html
Chris Dalby
@moose4621
Jun 18 2018 07:06
@moose4621 .. re websockets seems you may have to have port 81 open if coming in from outside router ..damn ...will feedback results tomorrow
Are you trying to access it from another network or the same network?
Chris Dalby
@moose4621
Jun 18 2018 07:19
@ashthespy I am still trying to come to grips with the uint casting. Can you tell me why I get this error? invalid conversion from 'uint8_t {aka unsigned char}' to 'uint8_t {aka unsigned char}' [-fpermissive]
den har
@denman0000_gitlab
Jun 18 2018 11:45
@moose4621 good day Moose .. How are you ? I too have problems there casting and conversion
@moose4621 Iam just tring to save the Payload 8 uint8_t to a file on spiffs ..I spent 3 hours trying to figure out how to convert it to the correct format :-(
Chris Dalby
@moose4621
Jun 18 2018 20:40
@denman0000_gitlab I have been looking at this example and wondering if I can get it to do what you want. https://tttapa.github.io/ESP8266/Chap16%20-%20Data%20Logging.html
@denman0000_gitlab Some stuff you don't need but I think maybe the concept is usable.
den har
@denman0000_gitlab
Jun 18 2018 20:42
@moose4621 how are you today :-)
@moose4621 cool will have a look there
Chris Dalby
@moose4621
Jun 18 2018 20:43
@denman0000_gitlab Hey, we finally are awake at the same time. Great how about you?
den har
@denman0000_gitlab
Jun 18 2018 20:43
@moose4621 why is it sooo difficult just to get data into the right format aaargh
@moose4621 yaaaay yes indeed I'm great too thanks .. Gl;ad you're great too
Chris Dalby
@moose4621
Jun 18 2018 20:43
Yeah, just another frustration you don't need.
den har
@denman0000_gitlab
Jun 18 2018 20:45
@moose4621 was thinking about your ping pong issue .. I sent a few links for you and you could somehow set the javascript client side to react to the pong from server :-) I tried a ping png last night and saw the message appear in the client browser console log (F12)
Chris Dalby
@moose4621
Jun 18 2018 20:46
@denman0000_gitlab So when you are writing these events to spiffs, are they indexed in some way for later identification?
den har
@denman0000_gitlab
Jun 18 2018 20:47
@moose4621 not a specific index yet but can assign a field in the table for that (something I thought about) the closest to inded so far is a device ID
Chris Dalby
@moose4621
Jun 18 2018 20:48
Yeah thanks very much for those links. I finally went with http://django-websocket-redis.readthedocs.io/en/latest/heartbeats.html and although the javascript needed adapting I managed to get it to work and now a warning popup appears to alert the operator. All done!
den har
@denman0000_gitlab
Jun 18 2018 20:48
I have managed to assemble (collect) the string on button click on client side and javascript now sends it to server and I used the examplle you sent to PRINTF in the console ... All I'm trying to do now is take that output and send it to SPIFFS
@moose4621 WOW man you are rocking this rice paddy :-) well done
Chris Dalby
@moose4621
Jun 18 2018 20:51
@denman0000_gitlab Lol, yeah I'm feeling good atm. Can you give my an idea of whats in the message at the server end?
den har
@denman0000_gitlab
Jun 18 2018 20:52
@moose4621 that's awesome :-) glad to hear it .. yes re data
standbuy
standby
Chris Dalby
@moose4621
Jun 18 2018 20:54
@denman0000_gitlab kml file might be next for me which is in parrallel with your projct but kml formatting is a killer.
@denman0000_gitlab Just found a library for writing kml files in arduino. Yay.
den har
@denman0000_gitlab
Jun 18 2018 21:00
@moose motor,outside,2018-06-18 12:00,1529316000,2018-06-19 12:00,1529402400,Normal,0001,0001
Chris Dalby
@moose4621
Jun 18 2018 21:02
@denman0000_gitlab Ok, thanks. I might have a play with it tonight after work if you haven't already soughted it out. Do you have your code on github?
den har
@denman0000_gitlab
Jun 18 2018 21:04
@moose4621 Negative re github .. its all over the place at the mo .. will see how to get it on git and then go from there and structure it ...it's spaghetti code at the mo LOL
@moose4621 wow ok re KML .. you did mention the geolocation stuff too .. very cool
Chris Dalby
@moose4621
Jun 18 2018 21:09
@denman0000_gitlab Only cool if it works. :-)
den har
@denman0000_gitlab
Jun 18 2018 21:10
@moose4621 haha i know it will work :-)
@moose4621 you're on a roll
Chris Dalby
@moose4621
Jun 18 2018 21:10
@denman0000_gitlab Ha ha, can't last forever!
den har
@denman0000_gitlab
Jun 18 2018 21:28
@moose4621 believe in yourself :-) and it will
den har
@denman0000_gitlab
Jun 18 2018 21:38
@moose4621 how did you get alerting to work in broweser ? Just ALERT "whatever " in .js ?
Chris Dalby
@moose4621
Jun 18 2018 21:39
@denman0000_gitlab if (heartbeat_interval === null) {
missed_heartbeats = 0;
heartbeat_interval = setInterval(function() {
try {
missed_heartbeats++;
if (missed_heartbeats >= 3){
alert("Signal to seeder lost! Check WIFI connection and reload page to continue");
throw new Error("Too many missed heartbeats.");
}
            connection.send(heartbeat_msg);
        } catch(e) {
            clearInterval(heartbeat_interval);
            heartbeat_interval = null;
            console.warn("Closing connection. Reason: " + e.message);
            connection.close();
        }
    }, 5000);
}
@denman0000_gitlab Thats weird
@denman0000_gitlab This is the important bit. alert("Signal to seeder lost! Check WIFI connection and reload page to continue");
den har
@denman0000_gitlab
Jun 18 2018 21:49
@moose4621 aha doing the eagle eye step by step layman coder filter and read now
Chris Dalby
@moose4621
Jun 18 2018 21:50
@denman0000_gitlab Off to work I go :-( Have a good evening.
den har
@denman0000_gitlab
Jun 18 2018 21:50
@moose4621 Thanks a million for catch up .. have an awesome day @ work andkeep well .. TY for help and will chat later