Crestron Proxy server!
My Crestron CP2E processor kept resetting when exiting the Crestron Mobile app on my android. I tried all sorts of things trying to figure out why it would crash one out of 2-4 times! It was never consistant either so that made trouble shooting a bit more difficult. I tried an empty program with only a few digital joins and the mobile module. I had a very simple VTpro project loaded on the android tablet and it would still crash when exiting. Very much a pain in the ass when your house resets on you everytime you exit!
I wanted to see what was going on and found this simple python proxy! I was able to run Crestron mobile through it and watched the output looking to see if there was something specific causing the crashes. All I ever saw was 'disconnectRequest'.
So perhaps Crestron mobile telling the CP2E's program it was disconnecting caused the reset? I decided to filter out the phrase 'disconnectRequest' and replace it with 'cookies'. I gave the new proxy with filtering a run and so far a week later I've had 0 crashes or resets of the processor. Yay!! So what happens when you don't tell the processor you are exiting? It keeps sending data to the proxy despite the tablet app being stopped... and eventually (3-4 minutes later) the processor just closes the connection. Simple enough! And if you reconnect before its disconnected the mobile app works fine, no issues!
Download the proxy here, modified a bit. I put this in my inittab on my debian system. I'm sure a raspberry PI could run this just fine as well. Proxy.py
You'll have to modify this line in the code to reflect the IP of your proxy server machines IP address instead of 172.16.0.10:
server = TheServer('172.16.0.10', long(sys.argv))
Call the proxy with these arguments:
proxy.py 172.16.0.246 41790
172.16.0.246 is the IP of my crestron processor, port 41790 is the mobile port for one of the tablets. You have to run a proxy for each device.
Sorry its so basic. I doubt anyone else will need this. mad @ spectrum-sound.com