Exceptions.HologramError.SerialError: Unable to detect a usable serial port

I am starting up a new use case of collecting temperature and humidity data using:
Raspberry Pi 3 Model B+
Power supply 5.25 v 2.5amp
Modem Type: Hologram Nova US 4G LTE Cat-M1 Cellular USB Modem (R410).
I’ve set up the SDK using ```
$ curl -L hologram.io/python-install | bash
$ curl -L hologram.io/python-update | bash
sudo modprobe option
sudo sh -c ‘echo -n 05c6 90b2 > /sys/bus/usb-serial/drivers/option1/new_id’
Disabled NB-IoT with AT+URAT=7
$ sudo hologram modem signal
Signal strength: 17,99

Running:
#!/usr/bin/python
import sys
import Adafruit_DHT
import time
import requests
import json

sys.path.append(“.”)
sys.path.append(“…”)
sys.path.append(“…/…”)

from Hologram.HologramCloud import HologramCloud

while True:

humidity, temperature = Adafruit_DHT.read_retry(22, 4)
data = {'humidity':humidity,'temperature':temperature}
json_data = json.dumps(data)
#send data to Hologram
if __name__ == "__main__":
	print "Testing Hologram Cloud class..."

	hologram = HologramCloud(dict(), network='cellular')

	print 'Cloud type: ' + str(hologram)

	recv = hologram.sendMessage(json_data,
								topics = ['Temperature'],
								timeout = 3)
	print 'RESPONSE MESSAGE: ' + hologram.getResultString(recv)
	
print(humidity,temperature)
print 'Temp: {0:0.1f} C  Humidity: {1:0.1f} %'.format(temperature, humidity)
time.sleep(10)

This code runs successfully outputting data 1 to 3 loops, and then the connection drops;
RESPONSE MESSAGE: Message sent successfully
(95.5, 27.299999237060547)
Temp: 27.3 C Humidity: 95.5 %
Testing Hologram Cloud class…
Cloud type: HologramCloud
Traceback (most recent call last):
File “Hologram/DHT_Hologram/dht_hologram.py”, line 40, in
timeout = 5)
File “/usr/local/lib/python2.7/dist-packages/Hologram/HologramCloud.py”, line 112, in sendMessage
result = super(HologramCloud, self).sendMessage(output, timeout)
File “/usr/local/lib/python2.7/dist-packages/Hologram/CustomCloud.py”, line 71, in sendMessage
self.open_send_socket(timeout=timeout)
File “/usr/local/lib/python2.7/dist-packages/Hologram/CustomCloud.py”, line 113, in open_send_socket
self.network.connect_socket(self.send_host, self.send_port)
File “/usr/local/lib/python2.7/dist-packages/Hologram/Network/Cellular.py”, line 118, in connect_socket
self.modem.connect_socket(host, port)
File “/usr/local/lib/python2.7/dist-packages/Hologram/Network/Modem/NovaM.py”, line 85, in connect_socket
raise NetworkError(‘Failed to connect socket’)
Exceptions.HologramError.NetworkError: Failed to connect socket

or Exceptions.HologramError.SerialError: Unable to detect a usable serial port

Follows is a the results of a port check script.

sudo python portcheck.py
PORT NAME: /dev/ttyUSB1 DESCRIPTION: Qualcomm CDMA Technologies MSM HWID: USB VID:PID=05C6:90B2 SER=1371f915 LOCATION=1-1.1.3
PORT NAME: /dev/ttyUSB0 DESCRIPTION: Qualcomm CDMA Technologies MSM HWID: USB VID:PID=05C6:90B2 SER=1371f915 LOCATION=1-1.1.3
PORT NAME: /dev/ttyAMA0 DESCRIPTION: ttyAMA0 HWID: 3f201000.serial

This seems to be a new issue with this modem, as I have had more reliable results with an identical setup (which is in a remote application right now)

Any suggestions on how I can troubleshoot or monitor the process with debug schema I would appreciate any ideas.

No responses, not even from Hologram who supplies the Nova marketing it as compatible with a Raspberry Pi? Based on other posts with little or no response where makers have had this particular and other similar issues connecting a Nova with U-blox R410 to a Raspberry Pi using the Cat-M1 network I’m assuming that Hologram.io has given up on providing any kind of support.
I have a Particle Boron LTE and a Soracom sim on the way. I’ll let you know how it goes.

Are you running any other modem managers or do you have a PPP session up? (That would happen by running hologram network connect) It’s possible that the serial port is being used by another process. It does seem from your script that the modem is working correctly and presenting the right ports.
You can check for ppp with ps -ef | grep ppp

One other thing I’d try is creating the HologramCloud class outside of your loop and only calling sendMessage inside it

P.S. Sorry we missed this one

Thanks Reuben for replying late on a Saturday,
Follows is the result from running:
pi@raspberrypi:~ $ ps -ef | grep ppp
pi 913 900 0 14:31 pts/0 00:00:00 grep --color=auto ppp

from a separate terminal
pi@raspberrypi:~ $ ps aux
pi 900 0.0 0.3 8492 3692 pts/0 Ss+ 14:30 0:00 -bash
root 929 0.0 0.0 0 0 ? I 14:32 0:00 [kworker/3:2-ev
root 943 0.0 0.0 0 0 ? I 14:34 0:00 [kworker/2:0-ev
pi 946 0.0 0.2 9788 2572 pts/1 R+ 14:35 0:00 ps aux

I’m am not aware of other modem managers running. When I’ve previously tried to remove the modem manager I get the following:

pi@raspberrypi:~ $ sudo apt-get purge modemmanager
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package ‘modemmanager’ is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

The connection to the cellular network is sporadic (at best). When it does work, as mentioned in my original post, the script ran through 1 - 3 loops as was confirmed on the Hologram Dashboard. The script would close with an error something like: ‘ERROR: Existing PPP session(s) are established by pid(s) [xxx]. Please close/kill these processes first’. Running ps aux after this script closure shows no PPP open. When I open a separate terminal while the script is running I do see a ppp session open. This ppp session closes instantly after the script shuts down. To this end I had previously followed the guidance on R410 Cat-M1/NB-IoT Nova Troubleshooting specifically the
" PPP Issues as follows: Establishing PPP connections, like when using the hologram network connect command on the Nova’s Python SDK, has not been reliable. This is an issue that is expected to get resolved as the network matures and becomes optimized."
and created a script that opens network connection with “hologram = HologramCloud(dict(), network=‘cellular’)” and closes the session at the end the script with no loops. I created a cron session that runs this script at a regular frequency. Because of the sporadic nature of the cellular connection even this does not function.
#!/usr/bin/python
import sys
import Adafruit_DHT
import time
import requests
import json

sys.path.append(".")
sys.path.append("..")
sys.path.append("../..")

from Hologram.HologramCloud import HologramCloud

humidity, temperature = Adafruit_DHT.read_retry(22, 4)
#temperature = '%.2f'%(temperature)
#humidity = '%.2f'%(humidity)
data = {'humidity':humidity,'temperature':temperature}
json_data = json.dumps(data)
#send data to Hologram
if __name__ == "__main__":
    print "Testing Hologram Cloud class..."

    hologram = HologramCloud(dict(), network='cellular')

    print 'Cloud type: ' + str(hologram)

    recv = hologram.sendMessage(json_data,
								topics = ['temp', 'hum'],
								timeout = 3)
    print 'RESPONSE MESSAGE: ' + hologram.getResultString(recv)

    print '*******************************'
		
print 'Temp: {0:0.1f} C  Humidity: {1:0.1f} %'.format(temperature, humidity)
print '*******************************'
hologram.network.disconnect()

I found a webpage from your team for identifying if my modem / sim is on a blacklist. I ran:

at+crsm=176,28539,0,0,12
and there were less than 24 F’s (some numbers in front of the string of F’s. I ran:
at+crsm=214,28539,0,0,12,“FFFFFFFFFFFFFFFFFFFFFFFF”
Still no good connections. By this I mean, I can get confirmation of:
pi@raspberrypi:~ $ sudo hologram modem signal
Signal strength: 17,99

pi@raspberrypi:~ $ sudo hologram send “test”
ERROR: Failed to connect socket
ERROR: Failed to connect socket (not sure why there are 2 responses)

Can you run the sudo hologram send command with -vv
That should give us some debug output.
Also do things work better immediately after a reboot of the pi and power cycle of the modem?

Thanks again Reuben:
pi@raspberrypi:~ $ sudo hologram send “test” -vv
DEBUG: checking for vid_pid: (‘12d1’, ‘1506’)
DEBUG: checking for vid_pid: (‘12d1’, ‘1001’)
DEBUG: checking for vid_pid: (‘05c6’, ‘90b2’)
INFO: Detected modem NovaM
DEBUG: checking port ttyUSB0
DEBUG: checking port ttyUSB1
DEBUG: [AT]
DEBUG: {}
DEBUG: {OK}
INFO: found working port at ttyUSB1
INFO: chatscript file: /usr/local/lib/python2.7/dist-packages/Hologram/Network/M odem/chatscripts/default-script
DEBUG: [ATE0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CMEE=2]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CPIN?]
DEBUG: {}
DEBUG: {+CPIN: READY}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CPMS=“ME”,“ME”,“ME”]
DEBUG: {}
DEBUG: {+CPMS: 0,23,0,23,0,23}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CMGF=0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CNMI=2,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CEREG=2]
DEBUG: {}
DEBUG: {OK}
INFO: Instantiated a NovaM interface with device name of /dev/ttyUSB1
DEBUG: [AT+CGMM]
DEBUG: {}
DEBUG: {SARA-R410M-02B}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CCID]
DEBUG: {}
DEBUG: {+CCID: 8944501810180195627}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CIMI]
DEBUG: {}
DEBUG: {234500007019562}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CEREG?]
DEBUG: {}
DEBUG: {+CEREG: 2,5,“D1C”,“C3CD411”,8}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CGMM]
DEBUG: {}
DEBUG: {SARA-R410M-02B}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CEREG?]
DEBUG: {}
DEBUG: {+CEREG: 2,5,“D1C”,“C3CD411”,8}
DEBUG: {}
DEBUG: {OK}
INFO: Connecting to: cloudsocket.hologram.io
INFO: Port: 9999
DEBUG: [AT+USOCR=6]
DEBUG: {}
DEBUG: {+USOCR: 0}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCO=0,“cloudsocket.hologram.io”,9999]
INFO: Disconnecting from cell network
INFO: Failed to disconnect from cell network
ERROR: An error occurred while attempting to send the message to the cloud
ERROR: Please try again.
RESPONSE MESSAGE: Unknown error

After a pi reboot (where the modem LED’s both go out and then first the blue LED lights, and then the red LED lights.
Then:
pi@raspberrypi:~ $ sudo hologram send “test” -vv
DEBUG: checking for vid_pid: (‘12d1’, ‘1506’)
DEBUG: checking for vid_pid: (‘12d1’, ‘1001’)
DEBUG: checking for vid_pid: (‘05c6’, ‘90b2’)
INFO: Detected modem NovaM
DEBUG: checking port ttyUSB0
DEBUG: checking port ttyUSB1
DEBUG: [AT]
ERROR: Unable to detect a usable serial port
And:
pi@raspberrypi:~ $ sudo hologram modem signal
ERROR: Unable to detect a usable serial port
pi@raspberrypi:~ $ cd Hologram
pi@raspberrypi:~/Hologram $ sudo python portcheck.py
PORT NAME: /dev/ttyUSB1 DESCRIPTION: Qualcomm CDMA Technologies MSM HWID: USB VID:PID=05C6:90B2 SER=1371f915 LOCATION=1-1.1.2
PORT NAME: /dev/ttyUSB0 DESCRIPTION: Qualcomm CDMA Technologies MSM HWID: USB VID:PID=05C6:90B2 SER=1371f915 LOCATION=1-1.1.2
PORT NAME: /dev/ttyAMA0 DESCRIPTION: ttyAMA0 HWID: 3f201000.serial
pi@raspberrypi:~/Hologram $

But running again when I see that I once again get a modem signal I get:
pi@raspberrypi:~/Hologram $ sudo hologram modem signal
Signal strength: 17,99
pi@raspberrypi:~/Hologram $ sudo hologram send “test” -vv
DEBUG: checking for vid_pid: (‘12d1’, ‘1506’)
DEBUG: checking for vid_pid: (‘12d1’, ‘1001’)
DEBUG: checking for vid_pid: (‘05c6’, ‘90b2’)
INFO: Detected modem NovaM
DEBUG: checking port ttyUSB0
DEBUG: checking port ttyUSB1
DEBUG: [AT]
DEBUG: {}
DEBUG: {OK}
INFO: found working port at ttyUSB1
INFO: chatscript file: /usr/local/lib/python2.7/dist-packages/Hologram/Network/Modem/chatscripts/default-script
DEBUG: [ATE0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CMEE=2]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CPIN?]
DEBUG: {}
DEBUG: {+CPIN: READY}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CPMS=“ME”,“ME”,“ME”]
DEBUG: {}
DEBUG: {+CPMS: 0,23,0,23,0,23}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CMGF=0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CNMI=2,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CEREG=2]
DEBUG: {}
DEBUG: {OK}
INFO: Instantiated a NovaM interface with device name of /dev/ttyUSB1
DEBUG: [AT+CGMM]
DEBUG: {}
DEBUG: {SARA-R410M-02B}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CCID]
DEBUG: {}
DEBUG: {+CCID: 8944501810180195627}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CIMI]
DEBUG: {}
DEBUG: {234500007019562}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CEREG?]
DEBUG: {}
DEBUG: {+CEREG: 2,5,“D1C”,“C3CD411”,8}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CGMM]
DEBUG: {}
DEBUG: {SARA-R410M-02B}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CEREG?]
DEBUG: {}
DEBUG: {+CEREG: 2,5,“D1C”,“C3CD411”,8}
DEBUG: {}
DEBUG: {OK}
INFO: Connecting to: cloudsocket.hologram.io
INFO: Port: 9999
DEBUG: [AT+USOCR=6]
DEBUG: {}
DEBUG: {+USOCR: 0}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCO=0,“cloudsocket.hologram.io”,9999]
ERROR: Failed to connect socket
INFO: Disconnecting from cell network
INFO: Failed to disconnect from cell network
ERROR: Failed to connect socket

This is a strange one because it appears to be registering to the network fine but then it can’t connect to the server when it needs to. Maybe the signal is dropping out over there

Can you run sudo hologram modem operator and see what comes back?

Here’s what I get:
pi@raspberrypi:~ sudo hologram modem signal Signal strength: 17,99 pi@raspberrypi:~ sudo hologram modem operator
Operator: AT&T Hologram

AT+COPS?
+COPS: 0,0,“AT&T Hologram”,8

AT+COPS=?
+COPS: (2,“AT&T”,“AT&T”,“310410”,8),(1,“313 100”,“313 100”,“313100”,8),(0,1,2,3,4),(0,1,2)

I’ve been curious what the 313 carrier is.

Thanks for sending that over.

I believe that 313 is a first responder emergency network we don’t actually have access to.

We’re investigating now to see if this is some networking issue affecting your SIM. Would you mind sending an email to support@hologram.io referencing this thread and we can pick things up on there?

Thanks Reuben, I sent the e-mail per your request.
Just wanted the community know there’s ongoing engagement. Much appreciated!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.