As the title says... Chat on...

User avatar
By bblinky
#44290 Hello world,

I'm working on getting some data from UDP packages sent to the MCU but when I send the package from the tool "Packet Sender" I just get jumbled data back...

This is my code:
Code: Select allport=6666
tmr.alarm(0, 1000, 1, function()
    if wifi.sta.getip() == nil then
        print("Waiting for IP...") 
    else
        print("IP:"..wifi.sta.getip()..", Port:"..port)
        tmr.stop(0)
    end
end)
srv=net.createServer(net.UDP)
srv:on("receive", function(srv, pl) print(pl) end)
srv:listen(port)


This is the packet (Hex & ASCII dump):
Code: Select all0000   ff ff ff ff ff ff 6c 62 6d 33 0f 77 08 00 45 00  ......lbm3.w..E.
0010   02 2e 5d 29 40 00 40 11 57 46 c0 a7 01 02 c0 a7  ..])@.@.WF......
0020   01 ff 19 36 19 36 02 1a be 23 41 72 74 2d 4e 65  ...6.6...#Art-Ne
0030   74 00 00 50 00 0e cc 00 00 00 02 00 00 00 00 00  t..P............
0040   00 74 51 9f 5e 66 93 00 00 aa a4 55 b0 b3 39 71  .tQ.^f.....U..9q
0050   6d 6c 00 6b 00 00 00 00 00 00 00 00 00 00 00 00  ml.k............
0060   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0070   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0080   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0090   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00a0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00b0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00c0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00d0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00e0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00f0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0100   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0110   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0120   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0130   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0140   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0150   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0160   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0170   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0180   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0190   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
01a0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
01b0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
01c0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
01d0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
01e0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
01f0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0200   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0210   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0220   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0230   00 00 00 00 00 00 00 00 00 00 00 00              ............


And this is the data I get back:
Code: Select all������lbm3w


The method I use was to go in Wireshark and find the package I wanted to send and the right click to "Copy bytes as Hex stream" and then put that in Packet Sender...

I'd obviously love to figure out how to get some proper data back to work with...

All answers are much appreciated :D

- bblinky
User avatar
By TerryE
#44681 Read my FAQ. You are missing a key aspect of the even sequencing. You haven't got an IP until you go theough the else branch. Move the net code up until after the stop. Also make sure that you use a current dev branch build from the vcloud build service.