Unable to receive message from dashboard

Continuing the discussion from Message.received handler throwing exception:

I am working on the SARA-R410M and trying to receive messages from the dashboard. I have been made aware there are issues with receiving SMS, so I am now only sending data messages.

When I use the CLI to do:
$ sudo hologram receive
it returns: Ready to receive data on port 4010

When I send a message from the dashboard, it eventually returns:
Failed to connect to device to send message
and the message is never received on the nova (except once it was out of many dozens of efforts which was weird)

When I open a socket and try to popReceiveMessage() in python, it returns:
Exception in thread Thread-2:
Traceback (most recent call last):
File “/usr/lib/python3.7/threading.py”, line 917, in _bootstrap_inner
self.run()
File “/usr/lib/python3.7/threading.py”, line 865, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.7/dist-packages/Hologram/CustomCloud.py”, line 336, in __incoming_connection_thread
recv += result
TypeError: can only concatenate str (not “bytes”) to str

I saw the same issue was discussed in the thread referenced here but the bugfix branch is no longer available and after making sure I have the newest version of the SDK, I still seem to have the issue.

Thank you in advance for any support!
Josh

When you say you have the newest version of the SDK you mean you installed the newest version from pip (the newest release) or the newest develop version from the branch on github? We are still pending on that release but this stack trace is helpful and I will take a look at it on our current development branch.

Dom,

Good point. I am using the newest release version obtained with pip. Mind pointing me in the direction of the most recent develop branch? I will give that a try.

Thanks,
Josh

the develop branch is has been a common topic for me lately haha so can check this thread

1 Like

Makes sense. Seems like a good number of people are looking to get messaging working more reliably on the new modems.

I installed the SDK from the develop branch, but the same issues are persisting. Often there is no indication that the message is received (dashboard returns: ‘Failed to connect to device to send message’) and on the occasions it does seem to go through, the SDK returns “TypeError: can only concatenate str (not “bytes”) to str”

Any other thoughts? I’m sure you know, but it’s crucial for my application that I can message my devices. Thanks!

Have you tried updating the firmware and turning off the low power modes on the R410? Those are both a pretty common issue we run into with the R410. We actually changed the factory settings with new batches of the Nova due to this. Let me see if we have a help desk article about how to turn all that off. If not I am sure reuben has posted it here before about turning off those settings

Here is one example

I had seen that post before and tried it, but my modem is returning an error when I try to change it (attached).
Capture

However, the messages seem to be going through consistently now, even though it still has the bug where it can not concatenate them. Is there anything about the modem being powered on for a while that would make this happen? I didn’t change anything else.

It can take awhile for the modem to scan and attach to a tower. That could be part of it

So I was having a similar issue with a string being read as bytes in my own code after transitioning from python 2 to 3, and so popped the line "result = result.decode(‘UTF-8’) into CustomCloud.py after line 331, and poof, it works!
newline

I know you mentioned this and I am assuming you and your team know about this, but for some reason a fix wasn’t working when I tried the code from the develop branch, so figured I would put it out here for any others having a similar issue.

Best,
Josh

1 Like

Thanks yeah we try to catch them where we can but the string encoding change between python 2 and 3 created a lot of surface area for things like this to pop up. I’ll make the change in the develop branch so that it makes it into the next release.

Actually can I have you try this patch:

sudo pip3 install -e git+https://github.com/hologram-io/hologram-python.git@bugfix/bufferrecv#hologram-python

if that works ill merge that in

Dom,

I gave it a try, but messages are not going through at all anymore. Dashboard returns, “Failed to connect to device to send message.”

I’ll let the Pi sit on for an hour or two and try again, but I was previously able to boot it up and receive a message immediately.

As an aside, even when I could consistently receive a message, I was still have issues receiving any follow-up messages. I would connect to the network, open up a socket, and would be able to receive a message within a few seconds of sending it from the dashboard. I then tried closing and reopening the socket as well as just leaving it open, but would never receive follow up messages. I also tried totally disconnecting from the cellular network and reconnecting, but it would give the error that the PPP session was still open even though it had returns that it closed successfully. But this is perhaps a totally unrelated issue.

yeah the PPP issue is also resolved in the develop branch. That whole process has been cleaned up a bit in that upcoming release.

As for receiving follow up messages, that I am not as sure about. I can look into that. Would you mind opening up an issue on github? Issues · hologram-io/hologram-python · GitHub

been trying to make that process more streamlined since its easier to track than here on the forums.

I will also test this on my own pi

I am able to receive multiple messages using that branch on my U201. I will try an R410 but running sudo hologram receive -vv looked like this for me:

sudo hologram receive -vv
DEBUG: checking for vid_pid: ('12d1', '1001')
DEBUG: checking for vid_pid: ('12d1', '1506')
DEBUG: checking for vid_pid: ('1546', '1102')
INFO: Detected modem Nova_U201
DEBUG: checking port ttyACM0
DEBUG: [AT]
DEBUG: {}
DEBUG: {OK}
INFO: found working port at ttyACM0
INFO: chatscript file: /home/pi/src/hologram-python/Hologram/Network/Modem/chats           cripts/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+CTZU=1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CTZR=1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CPMS="ME","ME","ME"]
DEBUG: {}
DEBUG: {+CPMS: 1,300,1,300,1,300}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CMGF=0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CNMI=2,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CREG=2]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CGREG=2]
DEBUG: {}
DEBUG: {OK}
INFO: Instantiated a Nova_U201 interface with device name of /dev/ttyACM0
DEBUG: [AT+UUSBCONF?]
DEBUG: {}
DEBUG: {+UUSBCONF: 0,"",,"0x1102"}
DEBUG: {}
DEBUG: {OK}
DEBUG: USB modem mode: 0
DEBUG: [AT+CCID]
DEBUG: {}
DEBUG: {+CCID: 8944500408176044288}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CIMI]
DEBUG: {}
DEBUG: {234507098604428}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CREG?]
DEBUG: {}
DEBUG: {+CREG: 2,5,"1BFF","70B4E5D",2}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+UPSND=0,8]
DEBUG: {}
DEBUG: {+UPSND: 0,8,1}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCR=6]
DEBUG: {}
DEBUG: {+USOCR: 0}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOLI=0,4010]
DEBUG: {}
DEBUG: {OK}
Ready to receive data on port 4010
DEBUG: {}
DEBUG: {+UUSOLI: 1,"10.176.100.4",40002,0,"10.170.210.77",4010}
DEBUG: URC! +UUSOLI: 1,"10.176.100.4",40002,0,"10.170.210.77",4010
DEBUG: handleURC state: 0
DEBUG: {}
DEBUG: {+UUSORD: 1,5}
DEBUG: URC! +UUSORD: 1,5
DEBUG: handleURC state: 2
DEBUG: [AT+UDCONF=1,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USORD=1,5]
DEBUG: {}
DEBUG: {+USORD: 1,5,"6669727374"}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+UDCONF=1,0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCL=1]
DEBUG: {}
DEBUG: {OK}
Received message: first
DEBUG: {}
DEBUG: {+UUSOLI: 1,"10.176.100.4",40038,0,"10.170.210.77",4010}
DEBUG: URC! +UUSOLI: 1,"10.176.100.4",40038,0,"10.170.210.77",4010
DEBUG: handleURC state: 2
DEBUG: {}
DEBUG: {+UUSORD: 1,6}
DEBUG: URC! +UUSORD: 1,6
DEBUG: handleURC state: 2
DEBUG: [AT+UDCONF=1,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USORD=1,6]
DEBUG: {}
DEBUG: {+USORD: 1,6,"7365636F6E64"}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+UDCONF=1,0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCL=1]
DEBUG: {}
DEBUG: {OK}
Received message: second
DEBUG: {}
DEBUG: {+UUSOLI: 1,"10.176.100.4",40074,0,"10.170.210.77",4010}
DEBUG: URC! +UUSOLI: 1,"10.176.100.4",40074,0,"10.170.210.77",4010
DEBUG: handleURC state: 2
DEBUG: {}
DEBUG: {+UUSORD: 1,5}
DEBUG: URC! +UUSORD: 1,5
DEBUG: handleURC state: 2
DEBUG: [AT+UDCONF=1,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USORD=1,5]
DEBUG: {}
DEBUG: {+USORD: 1,5,"7468697264"}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+UDCONF=1,0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCL=1]
DEBUG: {}
DEBUG: {OK}
Received message: third

Ok I tried with an R410 and it works for me:

 sudo hologram receive -vv
DEBUG: checking for vid_pid: ('12d1', '1001')
DEBUG: checking for vid_pid: ('12d1', '1506')
DEBUG: checking for vid_pid: ('1546', '1102')
DEBUG: checking for vid_pid: ('1546', '1104')
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: /home/pi/src/hologram-python/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: [AT+CMGF=0]
DEBUG: {}
DEBUG: {+CPMS: 0,23,0,23,0,23}
DEBUG: URC! +CPMS: 0,23,0,23,0,23
DEBUG: handleURC state: 0
DEBUG: URC was not handled. '+CPMS: 0,23,0,23,0,23'
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-01B}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CCID]
DEBUG: {}
DEBUG: {+CCID: 8944500410165967032}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+CIMI]
DEBUG: {}
DEBUG: {234507095596703}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCR=6]
DEBUG: {}
DEBUG: {+USOCR: 0}
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOLI=0,4010]
DEBUG: {}
DEBUG: {OK}
Ready to receive data on port 4010
DEBUG: {}
DEBUG: {+UUSOLI: 1,"10.176.100.4",40046,0,"10.117.93.35",4010}
DEBUG: URC! +UUSOLI: 1,"10.176.100.4",40046,0,"10.117.93.35",4010
DEBUG: handleURC state: 0
DEBUG: {}
DEBUG: {+UUSORD: 1,5}
DEBUG: URC! +UUSORD: 1,5
DEBUG: handleURC state: 2
DEBUG: [AT+UDCONF=1,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USORD=1,5]
DEBUG: {}
DEBUG: {}
DEBUG: {+USORD: 1,5,"6669727374"}
DEBUG: {OK}
DEBUG: [AT+UDCONF=1,0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCL=1]
DEBUG: {}
DEBUG: {OK}
Received message: first
DEBUG: {}
DEBUG: {+UUSOLI: 1,"10.176.100.4",40078,0,"10.117.93.35",4010}
DEBUG: URC! +UUSOLI: 1,"10.176.100.4",40078,0,"10.117.93.35",4010
DEBUG: handleURC state: 2
DEBUG: {}
DEBUG: {+UUSORD: 1,6}
DEBUG: URC! +UUSORD: 1,6
DEBUG: handleURC state: 2
DEBUG: [AT+UDCONF=1,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USORD=1,6]
DEBUG: {}
DEBUG: {}
DEBUG: {+USORD: 1,6,"7365636F6E64"}
DEBUG: {OK}
DEBUG: [AT+UDCONF=1,0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCL=1]
DEBUG: {}
DEBUG: {OK}
Received message: second
DEBUG: {}
DEBUG: {+UUSOLI: 1,"10.176.100.4",40104,0,"10.117.93.35",4010}
DEBUG: URC! +UUSOLI: 1,"10.176.100.4",40104,0,"10.117.93.35",4010
DEBUG: handleURC state: 2
DEBUG: {}
DEBUG: {+UUSORD: 1,5}
DEBUG: URC! +UUSORD: 1,5
DEBUG: handleURC state: 2
DEBUG: [AT+UDCONF=1,1]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USORD=1,5]
DEBUG: {}
DEBUG: {}
DEBUG: {+USORD: 1,5,"7468697264"}
DEBUG: {OK}
DEBUG: [AT+UDCONF=1,0]
DEBUG: {}
DEBUG: {OK}
DEBUG: [AT+USOCL=1]
DEBUG: {}
DEBUG: {OK}
Received message: third
^CClosing socket...
INFO: Closing socket...
DEBUG: [AT+USOCL=0]
DEBUG: {}
DEBUG: {OK}

I will merge in that change

1 Like

Sounds good. Not sure what is going on with mine. Doing the same thing, it is just total radio silence when I send the messages. The only difference I see is mine is ‘SARA-R410M-02B’ rather than ‘01B.’

Anyways, I’ll implement your most recent changes and fingers crossed it works. Will you merge these into the develop branch or the release branch? Thanks!

They are in develop at the moment but that means they will be in the next release as well. We have been QAing it but this week has been largely consumed by handling the outage that occurred on sunday.

I tend to use all the old equipment in the office since they still work but I can try it on a newer modem as well haha.

I grabbed the develop branch version, but no change. And yup, I totally get using the established hardware most of the time, but I am interested to see if you have the same results on the newer modem version (02B).

I was looking through the setting in the SARA-R4 series documentation, and it seems there are a few differences between the 01B and 02B. It also says the extended discontinuous reception can not be disabled using the CEDRXS for the R410M which is a suggestion in the post from Reuben (and which I suppose is why it returned an error when I tried).

Unfortunately the 02B one I have at my house seems to be broken so I will have to grab one from our office to try out. The encoding issue is fixed from those previous tests at least so thats one hurdle out of the way.

1 Like