These are chat archives for SmingHub/Sming

3rd
Jan 2017
Daniel Pechmann
@dpechman
Jan 03 2017 00:16
hey guys, having a issue here. my app can http post/get over the internet to a central server. But the inverse is not true, I cannot connect to the ESP-12-E webserver behind a router or over the internet. If the connection is not in the same IP range the http server is not working
looks like the esp-12 is receiving the request but cannot reach back to the client
in the local network is working fine
some clue?
Daniel Pechmann
@dpechman
Jan 03 2017 03:02
The IEEE has specified that the most significant bit of the most significant byte be used for this purpose. If its a 1, that means multicast, 0 means unicast. The most significant byte is the left most byte in the address, and the most significant bit is the right most bit of the byte (this is counter intuitive to most binary implementations where the left most bit usually labeled most significant).
The bit 0 of the first byte of MAC address specifies also if the sending frame is UNICAST or MULTICAST.
It seems that my (or every ?) router/gateway doesn't accept MULTICAST frame on ARP request.
ESP starts the mac address with 0x18.
so its unicast
Andriy Petrynchyn
@petrynchyn
Jan 03 2017 14:10
In SmingRTOS work NAT
teicors
@teicors
Jan 03 2017 14:13
@laurentppol I spent few time in duing some tests and I found that is not an issue: sorry ! It depends on the state of ESP (cold or warm reboot) and the availability of an ntp server. I had to wait up to three minutes to achieve a correct time from an NTP server.
Daniel Pechmann
@dpechman
Jan 03 2017 15:12
@petrynchyn So it has a NAT issue in Sming nonRTOS?
I have tried those days to start with SmingRTOS but finished frustrated about informations about it.
Alexander V. Ribchansky
@avr39-ripe
Jan 03 2017 15:16
@dpechman not nat issue, but mtu issue.. in nonos there was liblwip_536.a lib, in 1.4.0 nonos SDK with that lib it is possible to connect to esp + sming nonos FROM internet but with that lib other issues arise.. :(
Daniel Pechmann
@dpechman
Jan 03 2017 15:16
there is some guide step by step to configure SmingRTOS enviroment? docker? Virtual machine?
this MTU issue is only for http server ?
Alexander V. Ribchansky
@avr39-ripe
Jan 03 2017 16:19
@dpechman no, afaik mtu issue is for generic tcp connections with large tcp packets.. smaller data chunks (i. e. json encoded data,) "pass" this mtu issue, larger data (html pages, js-code, etc) do not "pass" :(
Daniel Pechmann
@dpechman
Jan 03 2017 16:57
@avr39-ripe yeah! i just open a json in there! the main page that is not woring have some large JS and a 4kb logo in png.
laurentppol
@laurentppol
Jan 03 2017 22:11

@all, question about start/stop WWW/(TCP) servers:
in examples I can see such code:

void startWebServer()
{
if (serverStarted) return;

    server.listen(80);
    server.addPath("/", onIndex);
    server.addPath("/config", onConfiguration);
    server.addPath("/config.json", onConfiguration_json);
    server.addPath("/state", onAJAXGetState);
    server.setDefaultHandler(onFile);
    serverStarted = true;

what about STOPPING server (deregistering handlers)?
ex I use "WebConfig" (with AP started) if there is NO connection, then can config my WiFi as client, stop AP. What about WWW server I started having no connection? I can't "see" WWW on Client address, should I somehow close server? [I want to start "next" server, with different content on Client address.