Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Network Broadcast Sender / Listener
Re: Network Broadcast Sender / Listener
James,
I finally had a chance to install the program you put up and you certainly seem to have been originally correct that it is a hardware issue of the network card. After I saw a few things from the chat program, mainly that the second computer didn't suffer from the 60 second timeout, I installed EG on the other computer and set up Broadcaster. The second computer continues to receive the broadcasts even after the 60 second time limit that will shut down the first one. So essentially for the first minute, both computers see the broadcast but after 60 seconds the same broadcast is only seen by the second computer unless I reawaken the first.
I guess the good news is that the issue is with the PC and not the router, the bad news is probably that it is an energy saving technique that I may not be able to disable. Any ideas where I should check to see if it is user configurable? There is very little manufacturer support for the computer but perhaps it is a Windows setting.
I set up a temporary workaround where EG runs a timer every 50 seconds and then transmits a UDP message. My concern with this is that I think I need to stop the computer from going to sleep and that I don't know if it will cause other issues since this computer runs for weeks at a time and that would mean the timer may send tens of thousands of messages during that period. I don't know if that matters...
If you have any thoughts please let me know, regardless thank you very much for troubleshooting this issue with me as I now have no doubts what the cause of the issue is.
I finally had a chance to install the program you put up and you certainly seem to have been originally correct that it is a hardware issue of the network card. After I saw a few things from the chat program, mainly that the second computer didn't suffer from the 60 second timeout, I installed EG on the other computer and set up Broadcaster. The second computer continues to receive the broadcasts even after the 60 second time limit that will shut down the first one. So essentially for the first minute, both computers see the broadcast but after 60 seconds the same broadcast is only seen by the second computer unless I reawaken the first.
I guess the good news is that the issue is with the PC and not the router, the bad news is probably that it is an energy saving technique that I may not be able to disable. Any ideas where I should check to see if it is user configurable? There is very little manufacturer support for the computer but perhaps it is a Windows setting.
I set up a temporary workaround where EG runs a timer every 50 seconds and then transmits a UDP message. My concern with this is that I think I need to stop the computer from going to sleep and that I don't know if it will cause other issues since this computer runs for weeks at a time and that would mean the timer may send tens of thousands of messages during that period. I don't know if that matters...
If you have any thoughts please let me know, regardless thank you very much for troubleshooting this issue with me as I now have no doubts what the cause of the issue is.
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Network Broadcast Sender / Listener
check settings in windows power saving options, and under the device manager you can check properties for you network card.
if you want specific help, tell me what OS you are using. (i.e. xp,vista,win7)
is it a laptop or a desktop?
is it a wireless connection or ethernet cable?
if you want specific help, tell me what OS you are using. (i.e. xp,vista,win7)
is it a laptop or a desktop?
is it a wireless connection or ethernet cable?
Re: Network Broadcast Sender / Listener
It is an Acer Revo 3610 running Win 7 64 bit Home Edition. The computer has both an active wired and wireless network but everything discussed thus far has been going through the wired network. The computer is considered a Nettop, basically a small desktop suited for an HTPC. It has the Nvidia Ion platform. I didn't see anything previously in power saving. I will check the device manager. Thanks.jitterjames wrote:check settings in windows power saving options, and under the device manager you can check properties for you network card.
if you want specific help, tell me what OS you are using. (i.e. xp,vista,win7)
is it a laptop or a desktop?
is it a wireless connection or ethernet cable?
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Network Broadcast Sender / Listener
try disabling the wireless altogether to make sure it isn't confusing things. (You could also try disabling the network card and using only the wireless to see if it makes a difference.)
under device manager if you select your network adapter and go to properties, there is a power management tab. Unselect "Allow the computer to turn off this device to save power" and check the other two.
I don't think that sending a packet every 50 seconds will cause any major problems, unless it prevents your machine from sleeping. It's not like it's going to build up in a cache somewhere getting bigger and bigger, it's a bit more like @#$ing in the wind.
You could also try using tcp instead of udp, but what exactly are you trying to accomplish here?
under device manager if you select your network adapter and go to properties, there is a power management tab. Unselect "Allow the computer to turn off this device to save power" and check the other two.
I don't think that sending a packet every 50 seconds will cause any major problems, unless it prevents your machine from sleeping. It's not like it's going to build up in a cache somewhere getting bigger and bigger, it's a bit more like @#$ing in the wind.
You could also try using tcp instead of udp, but what exactly are you trying to accomplish here?
Re: Network Broadcast Sender / Listener
I'm looking to control my PC in the room using the home theater control system. I did uncheck the box you mentioned and also disabled a lot of power saving/idle mode features in the NVidia control panel for networking. I think I'm going to check with Nvidia support on this. I am pretty confident the issue is with the nvidia control panel that is disabling the message from being received. Currently I did turn off sleep on the computer since it didn't appear to wake up from the network signal but I might have sent a poor signal at the time (program signal not system signal) which could also be why it didn't wake up. I'll play around with it for awhile and post back with anything I discover. Thanks again for the help.jitterjames wrote:try disabling the wireless altogether to make sure it isn't confusing things. (You could also try disabling the network card and using only the wireless to see if it makes a difference.)
under device manager if you select your network adapter and go to properties, there is a power management tab. Unselect "Allow the computer to turn off this device to save power" and check the other two.
I don't think that sending a packet every 50 seconds will cause any major problems, unless it prevents your machine from sleeping. It's not like it's going to build up in a cache somewhere getting bigger and bigger, it's a bit more like @#$ing in the wind.
You could also try using tcp instead of udp, but what exactly are you trying to accomplish here?
-
hanspettersson
- Posts: 42
- Joined: Sat Feb 20, 2010 2:42 pm
Re: Network Broadcast Sender / Listener
I got the iphone app iRule Pro, and wondering how i send commands to the app from eventghost?
I have got it working the other way
I have got it working the other way
Re: Network Broadcast Sender / Listener
Just a quick note on the current version of the plugin. It has a pretty serious bug where it will not use the default port when you first create new actions. This also made it totally incompatible with my older configurations (which used an older version with no option to change the port at the action level) unless I was going to go through and add the port to each action.
The fix in the plugin is as follows. Replace the first few lines of bcastSend:
~k
The fix in the plugin is as follows. Replace the first few lines of bcastSend:
Code: Select all
def bcastSend(self, eventString, payload="", port=0):
if (port==None) or (int(port)==0):
sendToPort=self.plugin.port
else:
sendToPort=int(port)
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Network Broadcast Sender / Listener
I wasn't aware of the problem because I never use the default port. Thanks for the fix.
Re: Network Broadcast Sender / Listener
Hi, I hope you are still supporting this plugin as it has been a while since the last post.
I'm trying to use Eventghost & Broadcaster to send a UDP packet to an Arduino. I can send a packet FROM the Arduino to EG no problem however the other way does not seem to be working. I ran WireShark and nothing was being sent on the port that I specified in the Broadcaster plugin.
I checked the plugin version and it says 2.2.500 but when I try the link in this thread from james, I get a 404 error. Any thoughts or suggestions on diagnostic tips?
I'm trying to use Eventghost & Broadcaster to send a UDP packet to an Arduino. I can send a packet FROM the Arduino to EG no problem however the other way does not seem to be working. I ran WireShark and nothing was being sent on the port that I specified in the Broadcaster plugin.
I checked the plugin version and it says 2.2.500 but when I try the link in this thread from james, I get a 404 error. Any thoughts or suggestions on diagnostic tips?
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Network Broadcast Sender / Listener
I suggest you start by testing it with something other than your Arduino. I am currently using whichever version of the Broadcaster plugin that ships with EventGhost when you do a standard download and install and I have no issues with it sending or receiving.
I have been misled by Wireshark in the past (probably because I was using it wrong) so don't be so sure that your message is not being sent.
I personally use the broadcaster plugin to send messages from EventGhost to VoxCommando but I am sure there are plenty of other ways to test it. One way is to send the message to EventGhost. If "respond to self broadcast" is on it should generate en event in EventGhost.
If you want more help you could try posting your xml or some screenshots I guess so that we can see what you are doing with your settings for the plugin or the macro that sends the broadcast. If you are trying to target the IP address of your Arduino, you could try to send to 255.255.255.255 to do a broadcast instead.
Good luck.
I have been misled by Wireshark in the past (probably because I was using it wrong) so don't be so sure that your message is not being sent.
I personally use the broadcaster plugin to send messages from EventGhost to VoxCommando but I am sure there are plenty of other ways to test it. One way is to send the message to EventGhost. If "respond to self broadcast" is on it should generate en event in EventGhost.
If you want more help you could try posting your xml or some screenshots I guess so that we can see what you are doing with your settings for the plugin or the macro that sends the broadcast. If you are trying to target the IP address of your Arduino, you could try to send to 255.255.255.255 to do a broadcast instead.
Good luck.
Re: Network Broadcast Sender / Listener
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1640" Guid="{5783BDD3-221B-452D-9277-D0B9B3F50A1B}" Time="1395185241.88">
<Autostart Name="Autostart" Expanded="True">
<Plugin Identifier="Task" Guid="{D1748551-C605-4423-B392-FB77E6842437}" File="Task">
gAIpLg==
</Plugin>
<Action>
EventGhost.EnableExclusive(XmlIdLink(-1))
</Action>
<Plugin Identifier="JRMC" Guid="JRMC" File="JRMC">
gAIpLg==
</Plugin>
<Plugin Identifier="Keyboard" Guid="{59CBD10F-C1D8-4ADB-999B-9B76BA360F1F}" File="Keyboard">
gAIpLg==
</Plugin>
<Plugin Identifier="BroadcastListener" Guid="{5E8DA56B-24AC-4092-9521-169343C5171C}" File="Broadcaster">
gAIoWAkAAABCcm9hZGNhc3RxAFgPAAAAMjU1LjI1NS4yNTUuMjU1cQFNNYKIWAIAAAAmJnECVQ0xOTIuMTY4LjAuMTk0cQN0cQQu
</Plugin>
<Plugin Identifier="SchedulGhost" Guid="{39EFE2FF-6CA9-4450-B0E3-1AA125420B37}" File="SchedulGhost">
gAIoWCEAAABDOlxQcm9ncmFtIEZpbGVzICh4ODYpXEV2ZW50R2hvc3RxAFgAAAAAcQFYDAAAAFNjaGVkdWxHaG9zdHECXXEDSwFLAYZxBGFdcQWGcQZLAHRxBy4=
</Plugin>
<Plugin Identifier="TCPEvents" Guid="{198090B7-0574-4F91-B2E7-1AF5BB37E2DE}" File="TCPEvents">
gAIoTQAEWAAAAABxAFgDAAAAVURQcQGJdHECLg==
</Plugin>
<Plugin Identifier="HID" Guid="{05A690D9-27C2-4AC5-B0DD-2F562619E922}" File="HID">
gAIoWAAAAABxAIiJiVVRXFw/XGhpZCNpcmRldmljZXYyJmNvbDAxIzImMjg5ODg4YWImMCYwMDAwI3s0ZDFlNTViMi1mMTZmLTExY2YtODhjYi0wMDExMTEwMDAwMzB9cQFNXgRVDlZlbmRvciBJRCAxMTE4cQJLbVgsAAAAQGlucHV0LmluZiwlaGlkX2RldmljZSU7SElELWNvbXBsaWFudCBkZXZpY2VxA00QAYlLAHRxBC4=
</Plugin>
</Autostart>
<Macro Name="Switch to mode: J River Media Center">
<Event Name="Task.Activated.Media Center 19" />
<Action>
EventGhost.EnableExclusive(XmlIdLink(30))
</Action>
</Macro>
<Macro Name="Switch to mode: Skype">
<Event Name="Task.Activated.Skype" />
<Action>
EventGhost.EnableExclusive(XmlIdLink(122))
</Action>
</Macro>
<Macro Name="Regen XML for VOXCommando">
<Event Name="SchedulGhost.regenXML" />
<Action>
BroadcastListener.Broadcast(u'event', u'refresh.Media', 33000)
</Action>
</Macro>
<Macro Name="Forced: Turn Off Computer" Enabled="False">
<Event Name="System.Suspend" />
</Macro>
<Macro Name="Re-enable monitor">
<Event Name="Main.Reenable.Display" />
<Event Name="System.Resume" />
<Action>
System.MonitorPowerOn()
</Action>
</Macro>
<Folder Name="Insteon Commands">
<Macro Name="Broadcaster: Broadcast: Map.Set" Expanded="True">
<Action>
BroadcastListener.Broadcast(u'Map.Set', u'HAVariables&&KristiIsHome&&False&&True', 33000)
</Action>
</Macro>
</Folder>
<Folder Name="Context Folder">
<Folder Name="J River Media Center" id="30">
<Macro Name="Play">
<Event Name="HID.Button.176" />
<Action>
JRMC.Play()
</Action>
</Macro>
<Macro Name="Pause">
<Event Name="HID.Button.177" />
<Action>
JRMC.Pause()
</Action>
</Macro>
<Macro Name="Stop">
<Event Name="HID.Button.183" />
<Action>
JRMC.Stop()
</Action>
</Macro>
<Macro Name="Previous Track">
<Event Name="HID.Button.182" />
<Action>
JRMC.Previous()
</Action>
</Macro>
<Macro Name="Next Track">
<Event Name="HID.Button.181" />
<Action>
JRMC.Next()
</Action>
</Macro>
<Macro Name="Up" Enabled="False">
<Event Name="Keyboard.Up" />
<Action>
JRMC.Up()
</Action>
<Action>
Window.SendKeys(u'{Up}', False)
</Action>
</Macro>
<Macro Name="Down" Enabled="False">
<Event Name="MceRemote.Mce.Down" />
<Action>
Window.SendKeys(u'{Down}', False)
</Action>
</Macro>
<Macro Name="Left" Enabled="False">
<Event Name="MceRemote.Mce.Left" />
<Action>
Window.SendKeys(u'{Left}', False)
</Action>
</Macro>
<Macro Name="Right" Enabled="False">
<Event Name="MceRemote.Mce.Right" />
<Action>
Window.SendKeys(u'{Right}', False)
</Action>
</Macro>
<Macro Name="Select">
<Event Name="MceRemote.Mce.Ok" />
<Action>
Window.SendKeys(u'{Enter}', False)
</Action>
</Macro>
<Macro Name="Rewind">
<Event Name="HID.Button.180" />
<Action>
JRMC.Rewind()
</Action>
</Macro>
<Macro Name="Fast-Forward">
<Event Name="HID.Button.179" />
<Action>
JRMC.Forward()
</Action>
</Macro>
<Macro Name="PageUp">
<Event Name="MceRemote.Mce.ChannelUp" />
<Action>
Window.SendKeys(u'{PageUp}', False)
</Action>
<Action>
EventGhost.AutoRepeat(0.59999999999999998, 0.29999999999999999, 0.01, 3.0)
</Action>
</Macro>
<Macro Name="PageDown">
<Event Name="MceRemote.Mce.ChannelDown" />
<Action>
Window.SendKeys(u'{PageDown}', False)
</Action>
<Action>
EventGhost.AutoRepeat(0.59999999999999998, 0.29999999999999999, 0.01, 3.0)
</Action>
</Macro>
<Macro Name="Switch zones">
<Event Name="Keyboard.LWin+7" />
<Action>
JRMC.SwitchZones()
</Action>
<Action>
Window.SendKeys(u'{Ctrl+T}', False)
</Action>
</Macro>
<Macro Name="Standard View">
<Event Name="Keyboard.LWin+8" />
<Action>
Window.SendKeys(u'{Ctrl+1}', False)
</Action>
</Macro>
<Macro Name="Theater View">
<Event Name="Keyboard.LWin+9" />
<Action>
Window.SendKeys(u'{Ctrl+4}', False)
</Action>
</Macro>
<Macro Name="Launch Skype">
<Event Name="Keyboard.LWin+0" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe', u'/nosplash', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Call Gramma">
<Event Name="Keyboard.LWin+2" />
<Event Name="Broadcast.Gramma" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallGramma.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Call Aunt Nicole">
<Event Name="Keyboard.LWin+3" />
<Event Name="Broadcast.AuntNicole" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallAuntNicole.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Call Nanny">
<Event Name="Keyboard.LWin+4" />
<Event Name="Broadcast.Nanny" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallNannyAndFred.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Call Dadda">
<Event Name="Keyboard.LWin+5" />
<Event Name="Broadcast.Daddy" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallDada.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Folder Name="Keyboard Intercepts">
<Macro Name="Keyboard 2">
<Event Name="Keyboard.2" />
</Macro>
<Macro Name="Keyboard 3">
<Event Name="Keyboard.3" />
</Macro>
<Macro Name="Keyboard 4">
<Event Name="Keyboard.4" />
</Macro>
<Macro Name="Keyboard 5">
<Event Name="Keyboard.5" />
</Macro>
<Macro Name="Keyboard 6">
<Event Name="Keyboard.6" />
</Macro>
<Macro Name="Keyboard 7">
<Event Name="Keyboard.7" />
</Macro>
<Macro Name="Keyboard 8">
<Event Name="Keyboard.8" />
</Macro>
<Macro Name="Keyboard 9">
<Event Name="Keyboard.9" />
</Macro>
</Folder>
</Folder>
<Folder Name="Skype" id="122" Enabled="False" Expanded="True">
<Macro Name="Up">
<Event Name="MceRemote.Mce.Up" />
<Action>
Window.SendKeys(u'{Up}')
</Action>
<Action>
EventGhost.AutoRepeat(0.59999999999999998, 0.29999999999999999, 0.01, 3.0)
</Action>
</Macro>
<Macro Name="Down">
<Event Name="MceRemote.Mce.Down" />
<Action>
Window.SendKeys(u'{Down}')
</Action>
<Action>
EventGhost.AutoRepeat(0.59999999999999998, 0.29999999999999999, 0.01, 3.0)
</Action>
</Macro>
<Macro Name="Right">
<Event Name="MceRemote.Mce.Right" />
<Action>
Window.SendKeys(u'{Right}')
</Action>
<Action>
EventGhost.AutoRepeat(0.59999999999999998, 0.29999999999999999, 0.01, 3.0)
</Action>
</Macro>
<Macro Name="Left">
<Event Name="MceRemote.Mce.Left" />
<Action>
Window.SendKeys(u'{Left}')
</Action>
<Action>
EventGhost.AutoRepeat(0.59999999999999998, 0.29999999999999999, 0.01, 3.0)
</Action>
</Macro>
<Macro Name="Answer">
<Event Name="Keyboard.LWin+6" />
<Event Name="Broadcast.Answer" />
<Action>
Window.SendKeys(u'{Ctrl+Alt+PageUp}', False)
</Action>
</Macro>
<Macro Name="Call Gramma">
<Event Name="Keyboard.LWin+2" />
<Event Name="Broadcast.Gramma" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallGramma.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Call Aunt Nicole">
<Event Name="Keyboard.LWin+3" />
<Event Name="Broadcast.AuntNicole" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallAuntNicole.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Call Nanny">
<Event Name="Keyboard.LWin+4" />
<Event Name="Broadcast.Nanny" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallNannyAndFred.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Call Dadda">
<Event Name="Keyboard.LWin+5" />
<Event Name="Broadcast.Daddy" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\CallDada.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Quit Skype">
<Event Name="Keyboard.LWin+1" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe', u'/shutdown', 0, False, 2, u'', False)
</Action>
</Macro>
<Macro Name="Set Idle Time on Skype Launch">
<Event Name="Task.Activated.Skype" />
<Action>
System.SetIdleTime(300.0)
</Action>
</Macro>
<Macro Name="Quit Skype if Idle for 5 minutes">
<Event Name="System.Idle" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe', u'/shutdown', 0, False, 2, u'', False)
</Action>
<Action>
Window.FindWindow(u'Media Center 17.exe', None, None, None, None, None, False, 0.0, 0)
</Action>
<Action>
Window.BringToFront()
</Action>
<Action>
EventGhost.Wait(1.0)
</Action>
<Action>
Window.SendKeys(u'{Ctrl+4}', False)
</Action>
</Macro>
<Macro Name="Hang Up">
<Event Name="Keyboard.LWin+Home" />
<Event Name="Broadcast.HangUp" />
<Action>
System.Execute(u'C:\\Program Files (x86)\\EventGhost\\AHKApps\\HangUp.exe', u'', 0, False, 2, u'', False)
</Action>
</Macro>
</Folder>
</Folder>
<Folder Name="SchedulGhost">
<Macro Name="Adjust and start egg timer">
<Action>
SchedulGhost.SetEggTimer()
</Action>
</Macro>
<Macro Name="Start egg timer">
<Action>
SchedulGhost.StartEggTimer()
</Action>
</Macro>
<Macro Name="Show currently running egg-timers">
<Action>
SchedulGhost.ShowRunningEggTimers()
</Action>
</Macro>
<Macro Name="Abort egg timer(s)">
<Action>
SchedulGhost.AbortEggTimers()
</Action>
</Macro>
<Macro Name="Show SchedulGhost">
<Action>
SchedulGhost.ShowSchedulGhost()
</Action>
</Macro>
<Macro Name="Hide SchedulGhost">
<Action>
SchedulGhost.HideSchedulGhost()
</Action>
</Macro>
<Macro Name="Enable schedule">
<Action>
SchedulGhost.EnableSchedule()
</Action>
</Macro>
<Macro Name="Disable schedule">
<Action>
SchedulGhost.DisableSchedule()
</Action>
</Macro>
<Macro Name="Enable all schedules">
<Action>
SchedulGhost.EnableAll()
</Action>
</Macro>
<Macro Name="Disable all schedules">
<Action>
SchedulGhost.DisableAll()
</Action>
</Macro>
<Macro Name="Get schedule">
<Action>
SchedulGhost.GetSchedule()
</Action>
</Macro>
<Macro Name="Add schedule">
<Action>
SchedulGhost.AddSchedule()
</Action>
</Macro>
<Macro Name="Delete schedule">
<Action>
SchedulGhost.DeleteSchedule()
</Action>
</Macro>
<Macro Name="Run schedule immediately">
<Action>
SchedulGhost.RunScheduleImmediately()
</Action>
</Macro>
<Macro Name="Save data to xml">
<Action>
SchedulGhost.DataToXML()
</Action>
</Macro>
<Macro Name="Reload data from xml">
<Action>
SchedulGhost.ReloadXML()
</Action>
</Macro>
</Folder>
</EventGhost>
One thing I should note about the Arduino. I've successfully gotten the Arduino to communicate with EventGhost (just not in the other direction). However, I was able to download a UDP sender on my phone and it allows me to send packets to the Arduino. The Arduino sees them and responds. The one thing about that program is it allows me to specify the IP of the Arduino. Is it possible the Arduino isn't replying due to the broadcast?
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Network Broadcast Sender / Listener
That is a rather large tree. How am I supposed to know which macros you are using with your Arduino?
In any case, it looks like you only have two macros that send UDP broadcasts. In both cases you are using port 33000. Your Arduino must be listening on this port, but should respond on port 33333
You can also set the IP address you wish to target in the broadcaster settings but no, I don't think it is very likely that this is the problem. I would stick with 255.255.255.255
How are you verifying that the Arduino is or is not receiving the message?
Maybe you should post your Arduino code.
In any case, it looks like you only have two macros that send UDP broadcasts. In both cases you are using port 33000. Your Arduino must be listening on this port, but should respond on port 33333
You can also set the IP address you wish to target in the broadcaster settings but no, I don't think it is very likely that this is the problem. I would stick with 255.255.255.255
How are you verifying that the Arduino is or is not receiving the message?
Maybe you should post your Arduino code.
Re: Network Broadcast Sender / Listener
Here is the Arduino Code
Here is the command that I'm using in the Broadcaster Plugin to send to the Arduino listening on port 1337.
In the Arduino code, the udpSerialPrint function will print out the IP, port, message received and message length tot the serial monitor built into the Arduino IDE. For diagnostics I also tried using the udpsender command line program that you wrote James and I get the same result, the Arduino still does not see the message. Is it possible that the Arduino is somehow on a different subnet or something? They're both attached to the same router right now. I've tried the Arduino both ways (with Static IP and with DHCP enabled) same results.
Code: Select all
//
// Environment: Pollin AVR NETIO board, Arduino 1.0.1, avr-netino (https://code.google.com/p/avr-netino/)
//
// This is a demo of sending udp packets
// 2012-07-08 <[email protected]> http://creativecommons.org/licenses/by-sa/3.0/
// Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
//
// On destination site you can receive the packets e.g. with
// nc -4ul 7777
//
// Note: The udp packets are always sent via the gateway (see below)
#include <EtherCard.h>
#include <IPAddress.h>
static unsigned int NETIO_CSPIN_ENC28J60 = 10;
static byte mymac[] = {0x4A,0x9C,0x61,0x9A,0xCD,0x75};
static byte ipMy[] = {192, 168, 0, 12};
static byte ipDestination[] = {192, 168, 0, 194};
static byte ipGateway[] = {192, 168, 0, 1};
unsigned int portMy = 8888;
unsigned int portDestination = 33333;
byte Ethernet::buffer[700];
char msg[] = {"&&Hello"};
char data1[] = {"Nothing"};
int myLength = 0;
String msgIn = "&&Nothing";
//callback that prints received packets to the serial port
void udpSerialPrint(word port, byte ip[4], const char *data, word len) {
IPAddress src(ip[0], ip[1], ip[2], ip[3]);
Serial.println(src);
Serial.println(port);
Serial.println(String(data).substring(0, len));
msgIn = String(data).substring(0, len);
Serial.println(len);
myLength = len;
}
void setup() {
Serial.begin(57600);
if (ether.begin(sizeof Ethernet::buffer, mymac, NETIO_CSPIN_ENC28J60) == 0){
Serial.println("Failed to access Ethernet controller");
} else Serial.println("Ethernet controller initialized");
// if (!ether.begin(sizeof Ethernet::buffer, mymac, 10)) {
// Serial.println( "Failed to access Ethernet controller");
// while(1);
// } else Serial.println("Ethernet controller initialized");
// if (!ether.dhcpSetup()) {
// Serial.println("Failed to get configuration from DHCP");
// while(1);
// } else Serial.println("DHCP configuration done");
// ether.printIp("IP Address:\t", ether.myip);
// ether.printIp("Netmask:\t", ether.mymask);
// ether.printIp("Gateway:\t", ether.gwip);
// In the udp packet a destination mac must be inserted. But the EtherCard library
// will only insert the gateway mac in the udp packet.
// So the gateway needs to be specified here even if destination is in same subnet.
ether.staticSetup(ipMy, ipGateway);
// wait until arp request to gateway is finished
while (ether.clientWaitingGw())
ether.packetLoop(ether.packetReceive());
//register udpSerialPrint() to port 1337
ether.udpServerListenOnPort(&udpSerialPrint, 1337);
//register udpSerialPrint() to port 42.
// ether.udpServerListenOnPort(&udpSerialPrint, 42);
}
void loop() {
ether.packetLoop(ether.packetReceive());
if (msgIn == "PLAY"){
ether.sendUdp(msg, sizeof msg, portMy, ipDestination, portDestination);
msgIn = "nothing";
}
}Code: Select all
<Macro Name="Broadcaster: Broadcast: PLAY">
<Action>
BroadcastListener.Broadcast(u'PLAY', u'', 1337)
</Action>
</Macro>Re: Network Broadcast Sender / Listener
So I think I need I to go to the Arduino forums. I just downloaded Packet Sender from packetsender.com and that program allows you to specify an IP address (like the Android app I was using). Once I do that on top of the specifying the port, everything works fine. So for whatever reason, the code that I have as it is written will not respond to UDP broadcasts.
-
hanspettersson
- Posts: 42
- Joined: Sat Feb 20, 2010 2:42 pm
Re: Network Broadcast Sender / Listener
How can i send a value from a variable?
In Python Ex. eg.plugins.BroadcastListener.Broadcast(u'Bedroom.TV.Status.Volume', u'Bedroom.TV.Status.Volume9999', 33333)
I want to add the value there the 9999 is.
In Python Ex. eg.plugins.BroadcastListener.Broadcast(u'Bedroom.TV.Status.Volume', u'Bedroom.TV.Status.Volume9999', 33333)
I want to add the value there the 9999 is.
