These are chat archives for SmingHub/Sming

23rd
Feb 2016
Sébastien
@sle118
Feb 23 2016 02:25
@slaff your port of gdbstub was very helpful, thank you!
@slaff @hreintke with debugger enabled, I was able to clean code and make 3 image format work on the image library : GIF JPG BMP
@hreintke could you look at PR SmingHub/Sming#588 ? What else would be needed to merge?
zhivko
@zhivko
Feb 23 2016 06:37
@slaff that would be great.
You have this functionality in your repo?
slaff
@slaff
Feb 23 2016 09:35

your port of gdbstub was very helpful, thank you!

@sle118 Glad to hear that. @hreintke What else needs to be done to merge the GDB PR SmingHub/Sming#350

Patrick Jahns
@patrickjahns
Feb 23 2016 10:46
Does anyone know how exactly pbuffer (pbuf) works? I am trying to figure out when the data in the buffer is removed and when it is kept. (Using the NETUTILS tools ?) @hreintke
slaff
@slaff
Feb 23 2016 10:48
The timers are taking care to fill the pbufs with data. If you want to understand that better get the source code of LWIP and check what the tcp timer and tcp slow timer are doing.
zhivko
@zhivko
Feb 23 2016 10:52
@slaff is ssl mature enough? I just need encrypting maybe is better to just hash message?
slaff
@slaff
Feb 23 2016 10:53
@zhivko SSL needs more testing. For the moment better to rely on something else.
zhivko
@zhivko
Feb 23 2016 10:53
Ok thanks
slaff
@slaff
Feb 23 2016 10:54
The HttpClient with SSL is not working 100% - either WDT reset or something else is happening, the tcp server aborts are not handled correctly, and other small things that need time and attention to get fixed.
hreintke
@hreintke
Feb 23 2016 11:08
This message was deleted
hreintke
@hreintke
Feb 23 2016 11:14
@patrickjahns @slaff :
The pbufs are the the "shared buffers" between LWIP and Sming.
Allocation is done by LWIP. Freeing by Sming in the TcpConnection::staticOnReceive function.
When errors, just free, when data received after the onReceive callback. err_t res = con->onReceive(p);
Patrick Jahns
@patrickjahns
Feb 23 2016 11:25
thanks - how does "eHPR_Wait" work? - I am trying to figure out a way to detect if the boundary of a multipart request has been split between two tcp packets (without creating additional buffer overhead). Also wondering if TCP receive has a way to limit the data being transmitted (i.e. delay an ack until the data has been processed?)
hreintke
@hreintke
Feb 23 2016 11:35
With the tcp_recved call tcp_recved(tcp, p->tot_len);The application confirms it has processed the data. so the tcp buffers from lwip can be freed. If tcp buffers are filling up, lwip will use the tcp protocol to limit the dataflow.
@slaff :
I really suggest to do the SSL testing in RTOS. One of the main differences is the WDT reset which should not occur due the the freertos multitasking.
slaff
@slaff
Feb 23 2016 12:37

One of the main differences is the WDT reset which should not occur

@hreintke That's the major reason for me to go over the same pain of integrating axtls in Sming.

@hreintke How about integrating GDB into Sming(NonOS) as part of the final Sming (NonOS) release?
Patrick Jahns
@patrickjahns
Feb 23 2016 12:41

@hreintke
Sorry for asking so much - I am trying to wrap my head around the http/tcp server part.
From what you are saying I looked again at the httpserverconnection::onRCV -> it always calls TcpConnection::onReceive(*buf) - but from there I can`t backtrace where the TcpConnection::staticOnRcv get handled

I am just wondering - since I thought that returning eHPR_Wait from the HTTP-Request parse Handler keeps the content in the buffer (i.e. here: https://github.com/SmingHub/Sming/blob/develop/Sming/SmingCore/Network/HttpRequest.cpp#L85) - but now while testing with a header that is split across 2 tcp packets - I experience a different behavior - the first part of the buffer will just be ignored and it parses only the second packet which fails.

My idea was to scan the incoming packets for CRLN - if packet A does not include CRLN - get the next packet and scan A+B; if it still does not have a CRLN flag, write packet 1 to filestream and get the next packet C; if B+C does not have CRLN ; write B and get D; HTTP specs require a CRLN before the content boundary - that way I can differentiate between the parts of a multipart request

hreintke
@hreintke
Feb 23 2016 12:42
@alon24 :
I cloned your smartcarandroid project, created the APK and installed. However the app shows as strange interface.
Have the same on my physical device and on a emulator from android studio.
Have you seen this before ? Any suggestions to solve ?
On the "alonhr" protocol :smile: What events are available in the application to send to esp ?
alon24
@alon24
Feb 23 2016 12:43
  1. strange ? maybe the hebrew text??
  1. Application willl not work on the simulator since, it needs wireless
hreintke
@hreintke
Feb 23 2016 12:44
smartcar.PNG
Patrick Jahns
@patrickjahns
Feb 23 2016 12:44
Okay while writing the last part an idea came to my mind - i don`t need a larger buffer to find the boundary - just in the size of the boundary + 4 chars -still it would be nice to clear the lwip buffer until tot_len - boundary+4 chars
alon24
@alon24
Feb 23 2016 12:44
@hreintke slide from left to right and u'll see a joystick controll)
that is 9-axis, be sure to use on device, as I did not enable it if no wireless (since i cannot connect to network at workplace)
currently the code accepts these:

if (commandToken[1] == "xyJoystick") {
            int x = commandToken[2].toInt();
            int y = commandToken[3].toInt();
            handleJoystickXY(x, y);
        }
        else if (commandToken[1] == "freq") {
            int pin = commandToken[2].toInt();
            int freq = commandToken[3].toInt();
            int pwr = commandToken[4].toInt();
            handleCheckFreq(pin, freq, pwr);
        }
        else if (commandToken[1] == "tune") {
            int freq = commandToken[2].toInt();
            int useSteering = commandToken[3].toInt();
            tuneCarParamaters(freq, useSteering);
        }
        else if (commandToken[1].startsWith("xy")) {
            int x = commandToken[2].toInt();
            int y = commandToken[3].toInt();
            handleFixedXy(x, y);
        }
        else if (commandToken[1] == "measure") {
            int dist = measure();
            if (publisDelegate) {
                publisDelegate("distance:" + String(dist));
            }
        }
its in the dev branch, and not all imlemented yet, I want to add ultrasonic (measure), and tune (freq, better motor control)...
void CarCommand::handleJoystickXY(int x, int y)  {
    if (y == 0){
        drive(0,0,0,0);
        return;
    }

    int absY = abs(y);
    int powerLeft = absY;
    int powerRight = powerLeft;
    int absX = abs(x);

    int dirLeft = 1;
    int dirRight =1;

    if (carParams.useSteeringMotor) {
        return handleUseSteeringMotor(x, y);
    } else {
        return handleNotUseSteeringMotor(x, y);
    }
}
hreintke
@hreintke
Feb 23 2016 12:48
@alon24 :
I do/did try to use it on the device. Just used the emulator to show you the picture.
swiping (in all directions) doesn't show the joystick
alon24
@alon24
Feb 23 2016 12:49
on the top there is the "hamburger" - to the left of the english text
click that
side menu - android
NavigationView
hreintke
@hreintke
Feb 23 2016 12:50
Yep, found it :smile:
alon24
@alon24
Feb 23 2016 12:52
(please remember - its a work in progress)...
hreintke
@hreintke
Feb 23 2016 12:52
Only have the hebrew text, except on the on/off button
Yes sure, I know it is work in progress, no problem at all.
hreintke
@hreintke
Feb 23 2016 12:57
Ok, leave you to work :smile: I will connect to my esp and will see the commands coming in.
BTW : have been working on a json input possibility on commandprocessing. Close to complete within RTOS. Should ease the coding of processCarCommands a lot.
alon24
@alon24
Feb 23 2016 12:58
share and I will see
:)
slaff
@slaff
Feb 23 2016 17:31
Pfewww... took me some time to figure out why SSL is working in the Echo_Sssl but not in the Basic_Ssl. It turned out that the HttpClient does not support multiple things like: 1 Working with chunked encoding. 2. Following redirects, 3. If the server closes the connection that is treated as failure. etc...
New working example is coming soon for you to test
Sébastien
@sle118
Feb 23 2016 17:39
Anyone has success with ILI9341 ?
I tried the demo and all I get is a black screen that doesn't seem to respond
Sébastien
@sle118
Feb 23 2016 19:32
wow... it's quiet here
zhivko
@zhivko
Feb 23 2016 20:49
@slaff are you working on Basic_Ssl within SmingRTOS
slaff
@slaff
Feb 23 2016 20:50
Not really, I just tried to migrate it, had some success and stopped for now
Buuut the SSL code is working without crashing in Sming NonOS
robotiko
@robotiko
Feb 23 2016 20:54
Great news slaff
@slaff
slaff
@slaff
Feb 23 2016 20:55
@robotiko - Get the latest version of the code and try the Basic_Ssl example
robotiko
@robotiko
Feb 23 2016 20:55
@slaff about the gdb, it seems that Sming integration is working
but we are still dealign with getting the proper gdb client to test it and make it work
slaff
@slaff
Feb 23 2016 20:56
Well, glad to hear that, and also sad that is still not merged :(
robotiko
@robotiko
Feb 23 2016 20:56
@slaff do not worry .. we asked several sources
to get a matching gdb so it works rigth away ..
I do really appreciate your effort
and it is a terrific addition to Sming
great contribution..
I guess will be in really soon
hreintke
@hreintke
Feb 23 2016 21:51
@slaff :
As mentioned before, I would appreciate when you do finish the SSL implementation within RTOS.
That is much more important than any added functionality within NONOS.
On very short notice I will stop including any major new updates to NONOS.
@slaff :
And on gdb : can you also prepare a PR to include gdb in RTOS ?
slaff
@slaff
Feb 23 2016 21:56
@hreintke Can you make one last Sming NONOS version and merge the PRs there. This way there will be something that is working and can be used. Plus it motivates the people that make PRs. After that release you can stop merging PRs.
hreintke
@hreintke
Feb 23 2016 22:01
@slaff : I will merge the gdb PR into NONOS develop if you squash the commits to one, and after that a quick test shows it still works.
robotiko
@robotiko
Feb 23 2016 22:01
@hreintke thanks a lot
@slaff can you please have a look at the GDB port to RTOS and also the SSL
?
RTOS has a lot of effort invested .. from @hreintke
and looks like GDB should be quite simple to add
not sure about the ssl
@he
hreintke
@hreintke
Feb 23 2016 22:04
@slaff : For ssl I am really doubting if we should take that route. It is not only the SSL functionality we need to test on stability but also if there are no problems with current functionality.
hreintke
@hreintke
Feb 23 2016 22:11
@slaff : What should I see there ? :smile:
Patrick Jahns
@patrickjahns
Feb 23 2016 22:12
@hreintke - before you stop merging things to NONOS can you maybe give a deadline until when additional features (which are tested working) can be merged?
Maybe let`s say end of February/Mid March? That way people can finish what they are working on and we have a final release before only fixes/problems will be merged?
slaff
@slaff
Feb 23 2016 22:13
@hreintke I squashed all commits as recommended.
Now I would expect that someone can test the code
robotiko
@robotiko
Feb 23 2016 22:14
@slaff I can test that it compiles.. (same thing travis will do )
but no that it works becuase we have the gdb client in windows .. with different gdb version
Alexander V. Ribchansky
@avr39-ripe
Feb 23 2016 22:21
@hreintke I dont think that it is good idea to just stop supporting nonos sming.. How many people test rtos port for production stability? Can you state that rtos port not worse than nonos? Is all "teasty" features from nonos ported to rtos? May be as a compromise we can kindly insist to port every new feature one want in nonos sming to port to rtos sming too? I'm ready to port all my contribution to rtos.. And I think other contributors and users support me
hreintke
@hreintke
Feb 23 2016 22:29
@avr39-ripe :
I am not saying : "I will stop support on NONOS" my statement is : "(major) new functionality will only be added to RTOS"
On features : In my opinion all is in. If I left out something, it is not on purpose and anyone can point be to those.
Patrick Jahns
@patrickjahns
Feb 23 2016 22:35
Do you consider for example http post as rtos only feature? or is it okay if I create it for nonos first (since I am using nonos in a project of mine currently ) and then move it over to rtos?
hreintke
@hreintke
Feb 23 2016 22:56
@patrickjahns :
That is the way I will do. I am some behind in merging PR's into NONOS, but as soon as that is done, I will announce the next release, with remarks on timing and moving to RTOS.