|
Post by megash0n on Jun 10, 2020 12:48:19 GMT -5
All,
I currently control my RMC via network API & python. I have no issues "controlling" the unit. What I need assistance with it receiving feedback from the unit. or... the status of a setting. I have toyed around with <EmotivaPing> and such, but I'm struggling to put all this together in code. I've read through the API doc several times, I know how to "read" and understand python enough to reverse-engineer other's code, but just having issues getting the data I need. I have found code to control the units which is how I worked up the code I have today. Is there anyone here that knows this well enough that could hop on a video conferencing solution to take a look at my code to help me figure out how to poll the RMC for status of things? Or, if you just have some code in any language that probes these processors to return values, I can probably figure out how to port it to python.
My setup is EventGhost running on my HTPC. EventGhost has a python plugin. When I hit buttons on my phone app, it sends commands to EventGhost to which I use to "trigger" the Python script passing it these variables. Using these variables, the Python script then interfaces with the network API on the RMC and carries out the command. I have been able to receive an "ack" back from the processor listening for UDP on port 7001, but have yet to figure out how to orchestrate the code to give me a specific status back so I can capture that in a variable for other functions.
Thanks in advance!
|
|
|
Post by JKCashin on Jun 10, 2020 16:36:28 GMT -5
Following!!!
|
|
|
Post by megash0n on Jun 12, 2020 13:55:05 GMT -5
I'm getting the response back from an EmotivaPing, but cannot seem to figure out the subscription or updates. I'm not sure if this data is broadcast out to 255.255.255.255 or if it is sent directly to the requesting device.
|
|
stiehl11
Emo VIPs
Give me available light!
Posts: 7,261
|
Post by stiehl11 on Jun 12, 2020 14:49:07 GMT -5
I'm getting the response back from an EmotivaPing, but cannot seem to figure out the subscription or updates. I'm not sure if this data is broadcast out to 255.255.255.255 or if it is sent directly to the requesting device. Is that a sub-net mask? If so, there's your problem.
|
|
|
Post by megash0n on Jun 12, 2020 14:51:07 GMT -5
I'm getting the response back from an EmotivaPing, but cannot seem to figure out the subscription or updates. I'm not sure if this data is broadcast out to 255.255.255.255 or if it is sent directly to the requesting device. Is that a sub-net mask? If so, there's your problem. it's a broadcast address.
|
|
stiehl11
Emo VIPs
Give me available light!
Posts: 7,261
|
Post by stiehl11 on Jun 12, 2020 20:57:52 GMT -5
Is that a sub-net mask? If so, there's your problem. it's a broadcast address. Ok, looked like either an IP address or a sub-net mask. As long as it doesn't adhere to either of those addressing schemes then I've got nothing.
|
|
|
Post by vcautokid on Jun 13, 2020 1:40:43 GMT -5
Hmmm would be cool cool to get a dump on how this all goes. You guys got me curious. But I am not a coder. But still I am curious.
|
|
|
Post by megash0n on Jun 13, 2020 6:00:04 GMT -5
it's a broadcast address. Ok, looked like either an IP address or a sub-net mask. As long as it doesn't adhere to either of those addressing schemes then I've got nothing. Not intending to be rude at all, but are you familiar with what a broadcast address is? At any rate, I'm getting the data back from the ping using the broadcast address. I'm also getting the ACK back on port 7002. I just cannot figure out how to retrieve the subscription, updates, etc information. I don't know if I'm using the wrong port or if I'm even establishing the requests correctly in the first place. The documentation on this could use significant enhancement.
|
|
|
Post by megash0n on Jun 13, 2020 6:08:33 GMT -5
Hmmm would be cool cool to get a dump on how this all goes. You guys got me curious. But I am not a coder. But still I am curious. I've e-mailed support a couple times about getting some assistance in the past with no response other than the automated e-mail with no ticket number. I was hoping to find someone here that had some experience with it. I'm not really a coder, but can reverse engineer and build new. I have basic coding skills I guess you'd say. I think the network api documentation is more meant for custom integrators that use software programs or know how to implement this into their solutions. I'm using some Python code I found to send the XML requests to the RMC. I'm controlling everything just fine. I simply need to be able to get status updates.
|
|
|
Post by megash0n on Jun 16, 2020 15:57:15 GMT -5
All, here is what I have so far using the Network API with Python as the programming language. I spent some time today commenting the code pretty well in hopes that it makes sense. I finally figured out that the code I copied from the Emotiva API messed up the quotes. After finally realizing this, I was able to fix the emotivaUpdate and emotivaSubscription code with proper quotes which fixed the issues. Now, I just need to figure out a good way to parse the received UDP traffic with EventGhost variables in order to update my home automation app with current values. I plan to also use some logic with current values to do more things down the road. One example is the DIM setting. I need to retrieve the current value and pass increments until it equals %0. Or, Emotiva can add the ability to set the DIM level directly which would be nice :-) Let me know if you have any questions. See attachment for the code.
|
|
|
Post by JKCashin on Jun 16, 2020 17:32:01 GMT -5
Wish I had an XMC-2 to try this out... I am a coder by trade
|
|
|
Post by AudioHTIT on Jun 16, 2020 17:44:58 GMT -5
Wish I had an XMC-2 to try this out... I am a coder by trade It would seem most of it should also work with an XMC-1, in fact I believe the only published API is from the XMC-1, so at this point it all should work.
|
|
|
Post by megash0n on Jun 16, 2020 17:49:25 GMT -5
Wish I had an XMC-2 to try this out... I am a coder by trade It would seem most of it should also work with an XMC-1, in fact I believe the only published API is from the XMC-1, so at this point it all should work. I agree. You are going to want to change the protocol to 2.0 or remove the protocol as it defaults to 2.0. I assume the xmc-1 is 2.0, but I have no clue.
|
|
|
Post by megash0n on Jun 16, 2020 17:50:22 GMT -5
Wish I had an XMC-2 to try this out... I am a coder by trade Awesome. Feel free to clean it up! 😂😂😂 I'm a hack when it comes to code. I can read most anything, but it takes a lot of time to reverse engineer for me.
|
|
|
Post by megash0n on Jun 16, 2020 19:40:32 GMT -5
Wish I had an XMC-2 to try this out... I am a coder by trade Actually, I don't love how I'm handling the normal and sleep audio modes in relation to sending the control info. Prior to cleaning up the code, each elif had a sUDP.send command. I cleaned all that up, but had to leave that section as is for now. I also send the update, ping and subscription differently. I need to take a step back and re-architect the whole thing so it is segmented/modularized better. If anyone is looking for a good event-driven automation program, definitely check out EventGhost. I had code in that script to talk to an iTach via IR at one point, but since my NIC stays active more often, I swapped everything over to the network API. There are so many plugins that work with different things.
|
|
|
Post by megash0n on Jun 20, 2020 10:08:10 GMT -5
After taking some time off from this project, I am scratching my head as to what to do with this information now that I can retrieve it. I have found through testing that I am unable, so far, to update my Home Automation app with MQTT because I'm using a custom SmartApp with Samsung Smartthings. All in all, I just wanted to update the app with current values of things to make it a bit easier on the wife. This whole thing is a bit of a mess. I'm running Docker on a Windows 10 machine that contains a running instance of a MQTT Broker and MQTT Bridge. These interface with Samsung Smartthings Cloud services to enable bidirectional communication and state updates. Unfortunately, the custom SmartApp I use for controlling my RMC and TV has "nested" items that I cannot figure out how to talk to directly. The joys of technology. It makes me wish I paid more attention in programming class.
|
|
|
Post by AudioHTIT on Jun 20, 2020 17:38:44 GMT -5
I’m just glad someone’s doing something with the network protocol, I’d love a new iPad app, but haven’t coded in far too long. I can make pretty prototypes though! Did you ever get a hold of Chuck Elliot’s code? It was Windows based, Visual Basic or C+ possibly. I think someone around here has it. Might give you some ideas.
|
|
|
Post by millst on Jun 20, 2020 19:13:55 GMT -5
I thought the protocol was fairly straight-forward, but I get that some people are not happy about the multi-port design. It doesn't integrate very well with some systems. I glanced at your code and it looks like you are fairly close.
Assuming you know the IP address of the XMC-1, you don't need to worry about the ping at all. The ping is just for broadcasting and discovering the IP.
If you are getting a positive ACK back on your subscribe request, then that means it worked and you are getting the status information. The XMC-1 will asynchronously provide you status. Your program needs to listen on the notification port (7003). I believe the XMC-1 figures out your IP from the subscribe request and passes everything back on the notification port.
-tm
|
|
|
Post by megash0n on Jun 20, 2020 19:46:59 GMT -5
I’m just glad someone’s doing something with the network protocol, I’d love a new iPad app, but haven’t coded in far too long. I can make pretty prototypes though! Did you ever get a hold of Chuck Elliot’s code? It was Windows based, Visual Basic or C+ possibly. I think someone around here has it. Might give you some ideas. I saw your work on that. It looked very nice. I did install his software, but it crashed on me.
|
|
|
Post by megash0n on Jun 20, 2020 19:49:28 GMT -5
I thought the protocol was fairly straight-forward, but I get that some people are not happy about the multi-port design. It doesn't integrate very well with some systems. I glanced at your code and it looks like you are fairly close. Assuming you know the IP address of the XMC-1, you don't need to worry about the ping at all. The ping is just for broadcasting and discovering the IP. If you are getting a positive ACK back on your subscribe request, then that means it worked and you are getting the status information. The XMC-1 will asynchronously provide you status. Your program needs to listen on the notification port (7003). I believe the XMC-1 figures out your IP from the subscribe request and passes everything back on the notification port. -tm Absolutely. I've been sending controls for a while. I just couldn't figure out how to receive updates and subscriptions. It took a while, but I figured out that the code I pasted from Emotiva's document had bad quotation marks. Common, rookie mistake on my side. I'm getting what I need now. I just need to figure out what to do with the information.
|
|