No connection on bootup

I cannot get a connection on boot up.
I’m running a Raspberry Pi 4, with the latest RPi OS (May2020). When I run the code from the command line I get a connection every time. When I run the code via crontab (@reboot) I get a connection error.

This happens whether I reboot via “reboot” command, or power down/up.

Here’s the code I’ve been running to test:


import sys
import os
import datetime
import random
import threading
import json
import time
import shutil

from Hologram.HologramCloud import HologramCloud
from Hologram.CustomCloud import CustomCloud
from urllib.request import urlopen
from datetime import datetime


#Configure Modem
credentials = {'devicekey': 'XXXXXXX'}
hologram = HologramCloud(credentials, network='cellular')
result =
if result == False:
	print('Failed to connect to cell network')
	errlog.write('Failed to connect to cell network: ' + time.strftime("%c") +'\n')
	print('Connected to Cell Network')
	errlog.write('Connected to cell network: ' + time.strftime("%c") +'\n')


Figures, as soon as I write up the problem a possible cause hits me… I’m booting up and running the script before the modem had time to come online. I’ve put a delay in there as so far it’s working fine.
Sorry for the distraction.

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