I’m using TCPClient.read() to receive 160.8 Kbps of data, and after a few seconds, all network traffic (TCPClient and cloud) stops. The Photon hasn’t hung though, it’s most definitely still running as I’ve checked using the serial port.
@ScruffR, Yes, the SPI is just sending data to the other hardware I’m driving, and never receives anything, so it should not make a difference whether or not that is physically connected to anything.
I’m afraid that code is far from minimal - I’m not even sure what server to connect it to. What I’m looking for is the minimum amount of code that shows the problem, ideally running against a public server.
The code for the Photon is in the original post, though you’ll probably want this Java application too as it runs the TCP server which the Photon connects to. You’ll need to edit the Photon code and change the IP to match whatever it needs to be on your local network.
@Techjar, I was unable to test your “minimal” application against the Java application you provided since it doesn’t include any dependency jars.
However, I wrote a simple tcp server in python which should probably do the same thing and tested the application against that.
import socket
import time
import struct
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('0.0.0.0',7545))
s.listen(1)
snddata = struct.pack('>BL', 0, 330)
snddata += '\0' * 330
while True:
conn, addr = s.accept()
print 'Connected ', addr
pak = conn.recv(5)
print 'Received capabilities packet ', pak
while True:
print 'Sending ', len(snddata)
print snddata.encode('hex')
try:
conn.send(snddata)
except:
break
time.sleep(1)
Unfortunately, I couldn’t reproduce the issue you are having. Could you provide a minimal example that reliably showcases the issue and maybe run your server on a public IP address?
@avtolstoy, Oh, oops, I do seem to have forgotten to include the lib directory. Download this version, and just combine its “lib” with the files from the other zip, as this is a slightly different version that’s not designed for use with that Photon code. My internet is rather slow so I don’t want to upload all the lib jars again. That’s also why I can’t just host this for you from my home network.
If you can’t get that working, I can try to cobble together something that implements the protocol and runs headless, then toss it on my dedicated server.