Hologram Nova works on headless pi zero, but doesn't work on c.h.i.p


#1

I was able to get the Nova working on a headless raspberrypi zero w via command line by following the docs. https://hologram.io/docs/reference/nova/user-manual/ But I need to move my project over to my c.h.i.p. because it has a built in battery manager so I can use it with a backup battery to allow the system to automatically shutdown cleanly when power is lost. I followed the same instructions and the installer script claims that everything was installed correctly, exactly the same as on the pi. Most commands even work on the c.h.i.p., but the send command has a bug where it brings up the PPP session, sends 10-30x as much data as needed (without successfully delivering the message), throws an error, and never kills the pppd process.

Working example from RP0W:

root@project1:/var/log# hologram modem signal
Signal strength: 18,2
root@project1:/var/log# hologram send "test"
RESPONSE MESSAGE: Message sent successfully

output in /var/log/messages:

Nov 6 08:13:52 project1 pppd[746]: pppd 2.4.7 started by punknubbins, uid 0
Nov 6 08:13:53 project1 chat[748]: abort on (BUSY)
Nov 6 08:13:53 project1 chat[748]: abort on (NO CARRIER)
Nov 6 08:13:53 project1 chat[748]: abort on (VOICE)
Nov 6 08:13:53 project1 chat[748]: abort on (NO DIALTONE)
Nov 6 08:13:53 project1 chat[748]: abort on (NO DIAL TONE)
Nov 6 08:13:53 project1 chat[748]: abort on (NO ANSWER)
Nov 6 08:13:53 project1 chat[748]: abort on (DELAYED)
Nov 6 08:13:53 project1 chat[748]: timeout set to 12 seconds
Nov 6 08:13:53 project1 chat[748]: report (CONNECT)
Nov 6 08:13:53 project1 chat[748]: send (AT^M)
Nov 6 08:13:54 project1 chat[748]: expect (OK)
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: OK
Nov 6 08:13:54 project1 chat[748]: – got it
Nov 6 08:13:54 project1 chat[748]: send (ATH^M)
Nov 6 08:13:54 project1 chat[748]: expect (OK)
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: OK
Nov 6 08:13:54 project1 chat[748]: – got it
Nov 6 08:13:54 project1 chat[748]: send (ATZ^M)
Nov 6 08:13:54 project1 chat[748]: expect (OK)
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: OK
Nov 6 08:13:54 project1 chat[748]: – got it
Nov 6 08:13:54 project1 chat[748]: send (ATQ0^M)
Nov 6 08:13:54 project1 chat[748]: expect (OK)
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: ATQ0^M^M
Nov 6 08:13:54 project1 chat[748]: OK
Nov 6 08:13:54 project1 chat[748]: – got it
Nov 6 08:13:54 project1 chat[748]: send (AT+CGDCONT=1,“IP”,“hologram”^M)
Nov 6 08:13:54 project1 chat[748]: expect (OK)
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: AT+CGDCONT=1,“IP”,“hologram”^M^M
Nov 6 08:13:54 project1 chat[748]: OK
Nov 6 08:13:54 project1 chat[748]: – got it
Nov 6 08:13:54 project1 chat[748]: send (ATDT99*1#^M)
Nov 6 08:13:54 project1 chat[748]: expect (CONNECT)
Nov 6 08:13:54 project1 chat[748]: ^M
Nov 6 08:13:54 project1 chat[748]: ATDT
99***1#^M^M
Nov 6 08:13:54 project1 chat[748]: CONNECT
Nov 6 08:13:54 project1 chat[748]: – got it
Nov 6 08:13:54 project1 chat[748]: send (^M)
Nov 6 08:13:54 project1 pppd[746]: Serial connection established.
Nov 6 08:13:54 project1 pppd[746]: Using interface ppp0
Nov 6 08:13:54 project1 pppd[746]: Connect: ppp0 <–> /dev/ttyACM0
Nov 6 08:13:58 project1 pppd[746]: local IP address 10.170.196.30
Nov 6 08:13:58 project1 pppd[746]: remote IP address 10.170.196.30
Nov 6 08:13:58 project1 pppd[746]: primary DNS address 212.9.0.135
Nov 6 08:13:58 project1 pppd[746]: secondary DNS address 212.9.0.136
Nov 6 08:14:05 project1 pppd[746]: Terminating on signal 15
Nov 6 08:14:05 project1 pppd[746]: Connect time 0.2 minutes.
Nov 6 08:14:05 project1 pppd[746]: Sent 470 bytes, received 390 bytes.
Nov 6 08:14:05 project1 pppd[746]: Connection terminated.
Nov 6 08:14:06 project1 pppd[746]: Exit.

Nonworking example from CHIP:

root@lilbro ~$ hologram modem signal
Signal strength: 19,1
root@lilbro ~$ hologram send "test2"
Traceback (most recent call last):
File “/usr/local/bin/hologram”, line 167, in module
if __name__ == ‘__main__’: main()
File “/usr/local/bin/hologram”, line 163, in main
_command_handlers[command_selected_prefix](args)
File “/usr/local/lib/python2.7/dist-packages/scripts/hologram_send.py”, line 141, in run_hologram_send
run_hologram_send_cloud(args)
File “/usr/local/lib/python2.7/dist-packages/scripts/hologram_send.py”, line 147, in run_hologram_send_cloud
sendTOTP(args, data)
File “/usr/local/lib/python2.7/dist-packages/scripts/hologram_send.py”, line 77, in sendTOTP
result = hologram.network.connect()
File “/usr/local/lib/python2.7/dist-packages/Hologram/Network/Cellular.py”, line 60, in connect
success = self.modem.connect(timeout = timeout)
File “/usr/local/lib/python2.7/dist-packages/Hologram/Network/Modem/Nova.py”, line 39, in connect
raise SerialError(‘Not enough serial ports detected for Nova’)
NameError: global name ‘SerialError’ is not defined

output in /var/log/mesages:

Nov 6 08:19:06 lilbro pppd[891]: pppd 2.4.6 started by punknubbins, uid 0
Nov 6 08:19:07 lilbro chat[892]: abort on (BUSY)
Nov 6 08:19:07 lilbro chat[892]: abort on (NO CARRIER)
Nov 6 08:19:07 lilbro chat[892]: abort on (VOICE)
Nov 6 08:19:07 lilbro chat[892]: abort on (NO DIALTONE)
Nov 6 08:19:07 lilbro chat[892]: abort on (NO DIAL TONE)
Nov 6 08:19:07 lilbro chat[892]: abort on (NO ANSWER)
Nov 6 08:19:07 lilbro chat[892]: abort on (DELAYED)
Nov 6 08:19:07 lilbro chat[892]: timeout set to 12 seconds
Nov 6 08:19:07 lilbro chat[892]: report (CONNECT)
Nov 6 08:19:07 lilbro chat[892]: send (AT^M)
Nov 6 08:19:07 lilbro chat[892]: expect (OK)
Nov 6 08:19:07 lilbro chat[892]: ^M
Nov 6 08:19:07 lilbro chat[892]: OK
Nov 6 08:19:07 lilbro chat[892]: – got it
Nov 6 08:19:07 lilbro chat[892]: send (ATH^M)
Nov 6 08:19:07 lilbro chat[892]: expect (OK)
Nov 6 08:19:07 lilbro chat[892]: ^M
Nov 6 08:19:07 lilbro chat[892]: ^M
Nov 6 08:19:08 lilbro chat[892]: OK
Nov 6 08:19:08 lilbro chat[892]: – got it
Nov 6 08:19:08 lilbro chat[892]: send (ATZ^M)
Nov 6 08:19:08 lilbro chat[892]: expect (OK)
Nov 6 08:19:08 lilbro chat[892]: ^M
Nov 6 08:19:08 lilbro chat[892]: ^M
Nov 6 08:19:08 lilbro chat[892]: OK
Nov 6 08:19:08 lilbro chat[892]: – got it
Nov 6 08:19:08 lilbro chat[892]: send (ATQ0^M)
Nov 6 08:19:08 lilbro chat[892]: expect (OK)
Nov 6 08:19:08 lilbro chat[892]: ^M
Nov 6 08:19:08 lilbro chat[892]: ATQ0^M^M
Nov 6 08:19:08 lilbro chat[892]: OK
Nov 6 08:19:08 lilbro chat[892]: – got it
Nov 6 08:19:08 lilbro chat[892]: send (AT+CGDCONT=1,“IP”,“hologram”^M)
Nov 6 08:19:08 lilbro chat[892]: expect (OK)
Nov 6 08:19:08 lilbro chat[892]: ^M
Nov 6 08:19:08 lilbro chat[892]: AT+CGDCONT=1,“IP”,“hologram”^M^M
Nov 6 08:19:08 lilbro chat[892]: OK
Nov 6 08:19:08 lilbro chat[892]: – got it
Nov 6 08:19:08 lilbro chat[892]: send (ATDT99*1#^M)
Nov 6 08:19:08 lilbro chat[892]: expect (CONNECT)
Nov 6 08:19:08 lilbro chat[892]: ^M
Nov 6 08:19:08 lilbro chat[892]: ATDT
99***1#^M^M
Nov 6 08:19:08 lilbro chat[892]: CONNECT
Nov 6 08:19:08 lilbro chat[892]: – got it
Nov 6 08:19:08 lilbro chat[892]: send (^M)
Nov 6 08:19:08 lilbro pppd[891]: Serial connection established.
Nov 6 08:19:08 lilbro pppd[891]: Using interface ppp0
Nov 6 08:19:08 lilbro pppd[891]: Connect: ppp0 <–> /dev/ttyACM2
Nov 6 08:19:12 lilbro pppd[891]: local IP address 10.170.196.30
Nov 6 08:19:12 lilbro pppd[891]: remote IP address 10.170.196.30
Nov 6 08:19:12 lilbro pppd[891]: primary DNS address 212.9.0.135
Nov 6 08:19:12 lilbro pppd[891]: secondary DNS address 212.9.0.136

And this is where it hangs until I kill [pppd pid] at which point the ppp session closes and the following is printed in /var/log/messages:

Nov 6 08:22:01 lilbro pppd[891]: Terminating on signal 15
Nov 6 08:22:01 lilbro pppd[891]: Connect time 2.9 minutes.
Nov 6 08:22:01 lilbro pppd[891]: Sent 3454 bytes, received 5327 bytes.
Nov 6 08:22:01 lilbro pppd[891]: Connection terminated.
Nov 6 08:22:01 lilbro pppd[891]: Exit.

Anyone have any ideas on how to get this working or where i should start looking?


#2

Are there any custom routes or other modem managers setup on the CHIP that might be conflicting with pppd? We’ll be releasing an update in the next week or two to the SDK for send message that should help here that adjusts when the sendMessage call requires a PPP connection. Will keep you posted, would love to hear more about what you’re building.
-Ryan


#3

There are two extra steps needed to get the same Pi experience on the CHIP.

  1. Stop ModemManager, in the terminal run $ killall ModemManager
  2. Increase power provided by the USB. This can be done a couple ways. I recommend connecting a LiPo battery as the first option. If you do not have a battery you can run the following command: $ sudo axp209 --no-limit

The USB power issue looks like an intentional limit by NTC (https://docs.getchip.com/chip.html#sudden-shutdown-brown-out)

Hope this helps!


#4

Thanks this worked great. I killed, and then removed, ModemManager, and the nova started working exactly as expected.

As I mentioned in the initial question, I am using a battery so I haven’t experienced a brownout on the chip. But thanks for the heads up on that as well.