Second intent is for that Pi to accept SSH over Spacebridge. Works great, but only if I issue the command
sudo hologram spacebridge &
The problem is doing both. If the Pi listens for Spacebridge then I cannot listen for inbound SMS.
Or vice-versa.
So how do get remote SSH control for a device already listening to SMS? I have tested while connected to WiFi (possible route problem) and off WiFi (seems to require sudo hologram spacebridge command not matter what).
You should be able to do both on a U201 Nova (2G/3G) if you run sudo hologram modem connect followed by sudo hologram receive --sms. The first command will allow you to Spacebridge into your Nova.
Outside of that you can create an SMS command that starts Spacebridge and build a process that re-starts the SMS listener when Spacebridge is closed.
My Python SMS code is
hologram = HologramCloud(credentials, network=‘cellular’,authentication_type=‘csrpsk’)
…
hologram.enableSMS()
…
sms_obj = hologram.popReceivedSMS()
…
constantly looping in the background.
When this code runs, I can receive an SMS, no problem. But I cannot connect with Spacebridge.
If I try to connect with SpaceBridge nothing happens. Putty just sits there, cursor upper left corner, until after a few minutes it says “Server unexpectedly closed network connection”.
If I try to run “sudo hologram modem receive” on the device I get an error (already connected).
If I stop my SMS code and run sudo hologram receive, no problem, I can SpaceBridge in.
So close, I can smell it… any thoughts?
Thank you!
while True: #start the loop
recv = hologram.popReceivedSMS() #makes the recv variable equal an incoming message
if recv is not None: #run the following code when a message comes in
cmd = recv.message #makes the cmd variable the payload of the message.
if cmd == ‘sb’:
os.system(“sudo hologram spacebridge &”)
then send a text with “sb” to start the spacebridge
my python runs on boot so I just end my session with a sudo reboot and that’s it