Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Can't send any UDP packets: Socket error
This thread has 6 replies. Displaying all posts.
Post 1 made on Thursday May 26, 2022 at 14:37
canavan
Long Time Member
Joined:
Posts:
July 2004
12
I want to wake up a device with WOL, but I always get a Socket error when I try to send an UDP packet, even with a minimal example such as:
var s = new UDPSocket();s.send("ABC", "10.0.0.2", 4100);
The code works flawlessly in the simulator, and even wakes up the device, but as far as I can tell, my TSU 9600 with firmware 7.4.22 doesn't even try to send anything, and instead throws the Socket Error when send() is called. The error occurs with any destination address I've tried, e.g. multicast, broadcast, existing local or remote hosts. TCP sockets to control the device in question or other devices work as expected. Other devices in the same WiFi network can send WOL packets without issues. PEP Version is 3.0.23.0. I've even started a new master project from the supplied templates, with no change in behavior.
Post 2 made on Sunday May 29, 2022 at 02:21
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,829
Is there a version 7.4.22? Latest I'm aware of is 7.3.3.

In order for your Pronto to use TCP and UDP sockets, you must configure the network mode to support Serial Extenders.

Next, you might try wrapping your code with a try/catch block to trying to determine what exception you are getting using System.print(err).

Have you also tried this? Found via a search for Wake On LAN.

see [Link: remotecentral.com] post no. 7

I presume the device you are trying to wake up is hard-wired to your network and not Wifi? If it is Wifi, then you may have an issue with your router/access point not allowing a wifi device to connect to and send commands to another device on my network.

I forget what that setting is on my PakEdge but I had to enable it to allow the pronto to talk to a raspberry pi zero that I have in house.

Last edited by Lyndel McGee on May 29, 2022 15:57.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 3 made on Monday May 30, 2022 at 23:13
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,829
Did you find a solution?
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 4 made on Tuesday June 14, 2022 at 19:29
canavan
Long Time Member
Joined:
Posts:
July 2004
12
Sorry about the late response - my browser has cached this thread despite a few restarts and reboots, and I just haven't reloaded this page until now.

It's working right now, I've switched from the broadcast address for my local network (10.255.255.255) to 224.0.0.1. It is not clear to me why that would make a difference, especially since the simulator was working either way.

I've tried a few things on the way, among others, I've run netcat on my Raspberry Pi, listening for UDP packets I've sent in unicast and broadcast mode from both the Pronto and the simulator:
$ sudo nc -u -dkl 234
and then sent plain text e.g. with
UDPSocket.send("packet ", "224.0.0.1", 234);
That should work for port 9 (where WOL packets are sent) instead of 234 as well.

On May 29, 2022 at 02:21, Lyndel McGee said...
Is there a version 7.4.22? Latest I'm aware of is 7.3.3.

There is, see e.g. here: [Link: remotecentral.com]

In order for your Pronto to use TCP and UDP sockets, you must configure the network mode to support Serial Extenders.

I can use TCP sockets, contolling the AVP via TCP after I've turned it on by other means (e.g. from the simulator) works (minus my bugs regarding socket reuse and reading back unsolicited status updates)

Next, you might try wrapping your code with a try/catch block to trying to determine what exception you are getting using System.print(err).

That doesn't provide any additional information: the exception name is "Panel Error" and the exception message is "Socket error". The stack is just the pretty shallow call stack from the button to the sendWOL() function. It's basically the same I've seen in onIOError() callback.

Have you also tried this? Found via a search for Wake On LAN.

see [Link: remotecentral.com] post no. 7

sorry, I can't see any actual link there. was it this one? [Link: remotecentral.com]

I presume the device you are trying to wake up is hard-wired to your network and not Wifi?

correct.

If it is Wifi, then you may have an issue with your router/access point not allowing a wifi device to connect to and send commands to another device on my network.

I now know that that is not the case, since I was able to send WOL packets from a linux laptop connected to the same WiFi network and access point the Pronto uses, and that successfully wakes up the AVP. The access point runs in bridge mode, so broadcast packets should be absolutely no problem.

I still have the weird issue that the simulator cannot use TCP sockets - at least there the error message is a bit more verbose "Failed to connect". I can connect to all the devices from the same Windows PC using e.g. putty. Any Ideas regarding that?
Post 5 made on Wednesday June 15, 2022 at 22:27
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,829
The link you posted is the one I was referencing. 224.0.0.1 is likely the router address on Sogliphy's network.

Did you install John Welfringer's TCP Mod for the simulator? In this entire thread I did not see a mention of PEP2 vs PEP3. Which one are you using? The simulator program is NOT the same firmware rev as you might load into the Pronto. i.e. Apple != Orange.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Wednesday July 6, 2022 at 20:34
canavan
Long Time Member
Joined:
Posts:
July 2004
12
224.0.0.1 is actually a multicast address, it's turned into an ethernet broadcast address at the hardware level, and reaches all stations in the local broadcast domain. There seems to be an issue with the Firmware of the AVP I'm using in that it is unnecessarily picky about the WOL packets if it hasn't been soft powered off before, i.e. if I turn it on and off again, it wakes up with 224.0.0.1 as well, until I disconnect it from the mains. I'll use a trigger cable from the extender as a workaround, since there's already 5V, and that should be good enough.

I had downloaded John Welfringer's TCP Mod before, but totally forgotten about it. After installing it, TCP connections are actually working in the simulator.
Post 7 made on Thursday July 7, 2022 at 18:36
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,829
On July 6, 2022 at 20:34, canavan said...
I had downloaded John Welfringer's TCP Mod before, but totally forgotten about it. After installing it, TCP connections are actually working in the simulator.

That is what I use these days to debug all my stuff. System.setDebugMask(9) and everything shows up on the Prontoscript console.

Be aware that there are some things that don't work on the simulator like onSleep/onWake and you must put buttons on the screen to simulate those

'Sleep'

CF.activity().onSleep();

'Wake'

CF.activity().onWake();

This makes testing your startup/shutdown logic for TCP connections based on these events very easy to write/debug.

Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse