Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
den har
@denman0000_gitlab
@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
@denman0000_gitlab Only cool if it works. :-)
den har
@denman0000_gitlab
@moose4621 haha i know it will work :-)
@moose4621 you're on a roll
Chris Dalby
@moose4621
@denman0000_gitlab Ha ha, can't last forever!
den har
@denman0000_gitlab
@moose4621 believe in yourself :-) and it will
den har
@denman0000_gitlab
@moose4621 how did you get alerting to work in broweser ? Just ALERT "whatever " in .js ?
Chris Dalby
@moose4621
@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
@moose4621 aha doing the eagle eye step by step layman coder filter and read now
Chris Dalby
@moose4621
@denman0000_gitlab Off to work I go :-( Have a good evening.
den har
@denman0000_gitlab
@moose4621 Thanks a million for catch up .. have an awesome day @ work andkeep well .. TY for help and will chat later
den har
@denman0000_gitlab
hi all
Develo
@devyte
@denman0000_gitlab hello
den har
@denman0000_gitlab
@devyte Hi How are you ?
@devyte Well thanks and you ?
Anton Kristensen
@antonedvard
im loosing my mind! i am trying to multiply 0.001678466796875 but i only get 0.00 defining the variable as a float
Chris Dalby
@moose4621
@antonedvard @denman0000_gitlab Good morning all.
@antonedvard Try Serial.println(answer,15);
@antonedvard The 15 is the number of decimal places to print.
Develo
@devyte
interesting discussions you're all having here, I'm glad to see ongoing discussions for the ESP
Chris Dalby
@moose4621
@devyte Hi devyte, what's happenin'?
Develo
@devyte
too much, actually :) repo issue cleanup, PR reviews, mdns rewrite, investigation into a batmanadv-like mesh implementation, migration of all .c files to .cpp files, migration to a new gcc, exceptions, stability fixes....
and too little time
oh, and also an experimental integration of w5100/w5500 ethernet shields into lwip as additional interfaces
Chris Dalby
@moose4621
@devyte Ok..... Now I feel inadequate. :-(
Develo
@devyte
:D I feel that way myself about some of what the fellow developers have done. That bearssl alternative to axtls was a huge piece of code, the migration to lwip2 was mindboggling, as is the integration into lwip of the ethernet shields, and don't get me started on the available heap improvements and stack placement voodoo
Ash
@ashthespy
@moose4621 what are you trying to typecast?
Chris Dalby
@moose4621
@ashthespy Same as before. void sendSettings() { uint16_t data[] = {setpointVariable, targetGroundSpeed}; uint8_t payload = (uint8_t *)data; webSocket.broadcastBIN(payload, sizeof(payload)); }
Two int over 8 byte array.
@ashthespy I have it working using my own bastardized method but still want/need to understand typecasting. 'int setpointVariable100 = setpointVariable / 10;
int setpointVariable10 = setpointVariable - (setpointVariable100 10);
int targetGroundSpeed100 = targetGroundSpeed / 10;
int targetGroundSpeed10 = targetGroundSpeed - (targetGroundSpeed100
10);
uint8_t payload[4] = {0, 0, 0, 0};
payload[0] = setpointVariable100;
payload[1] = setpointVariable10;
payload[2] = targetGroundSpeed100;
payload[3] = targetGroundSpeed10;
webSocket.broadcastBIN(payload, sizeof(payload));'
Develo
@devyte
uint8_t payload = (uint8_t )data; => uint8_t payload = (uint8_t *)data;
?
stupid markup
uint8_t payload = (uint8_t *)data;
=>
uint8_t *payload = (uint8_t *)data;
?
Chris Dalby
@moose4621
@devyte Thanks devyte, your answer was the ticket.
@ashthespy Thanks for your time as always. Didn't work though.
Sooo need to understand this stuff.
Ash
@ashthespy
@moose4621 Sorry stepped out -> as @devyte mentioned you need to cast to a pointer
void sendSettings() {
  uint16_t data[] = {setpointVariable, targetGroundSpeed};
  uint8_t* payload = (uint8_t *)data;
  webSocket.broadcastBIN(payload, sizeof(payload));
}
Chris Dalby
@moose4621
I need to do similar to write the same int to the Eeprom. I guess I can use the same method?
Ash
@ashthespy
Lookup unions :-)
Chris Dalby
@moose4621
OK, thanks Ash. Have to go to work now but I will tonight. Appreciate your help.
Develo
@devyte
careful, sizeof(payload) may not be what you want, as it will always return 4 (size of a pointer in 32bit arch)
there are other ways of doing what I think you want, which is essentially to serialize two values
Ash
@ashthespy
The more I look at it my code - the more I see how I just got lucky.
Chris Dalby
@moose4621
@devyte serialize?
Develo
@devyte
if you're sure that your values will always fit in a uint16_t, then your original approach is not too bad. You probably want something like this:
void sendSettings() {
  uint16_t data[] = {setpointVariable, targetGroundSpeed};
  webSocket.broadcastBIN((uint8_t *)(&data[0]), sizeof(data));
}
Ash
@ashthespy
As makuna pointed out - this needs to be deserialized big endian though for the esp8266
Chris Dalby
@moose4621
@devyte That's great. I know my int will never exceed 300 but I need to understand this anyway.