Bad Magic Number

I’m trying to do some basic testing with the Hologram Nova from the CLI. When I try “sudo hologram modem signal” I get a ImportError: bad magic number in ‘HologramAuth’.

I’ve read in general the best way around this is to delete the .pyc files. I went through the /usr/local/lib/python3.6/dist-packages/Hologram folder and deleted all the .pyc files from all the folders but I still receive this error. Is there anything else I can try?

I am using the Hologram Nova with a Odroid N2 running Ubuntu 18.04.2.

Thanks

Try reinstalling the packages with:

sudo pip uninstall hologram-python
sudo pip uninstall python-sdk-auth
sudo pip install hologram-python

Using just pip, it will not install. It says "Could not find a version that satisfies the requirement python-sdk-auth~=0.3.0 (I do have python 2.7 installed)

But if I used pip3 it does install but I still receive the Bad Magic Number error

Oh yes, my mistake, need to use pip3 for latest SDK version.

Haven’t seen that error before. Sounds like something is corrupted somewhere. Can you try those commands again, but when doing the install, try with --no-cache-dir option

Still got the same “bad magic number”

sudo pip3 uninstall hologram-python
sudo pip3 uninstall python-sdk-auth
sudo pip3 install --no-cache-dir hologram-python
sudo hologram modem signal

Hmm can you run with -vv and post the full output?

We’ve never tested on the Odroid platform before. Do you know if the CPU is a similar architecture to raspberry pi

Odroid uses the ARM Cortex A73 and Pi3 uses ARM Cortex A53. I think the Pi4 uses the ARM Cortex A72

I’m having trouble attaching the output. I tried pdf but was blocked because I just registered and then tried to directly copy and paste and it was over the character limit and had too many links

Try now, I bumped you up to a normal user

output.pdf (120.5 KB)

Oh I meant running the signal command with -vv

Sorry about that.

output.pdf (59.3 KB)

I believe this is a problem due to version incompatibility. We released the sdk auth for versions of python 3.7 and greater. It is compiling the python sdk to 3.6 from your earlier pdf but the sdk auth library is not compatible with older versions of python since its already compiled.

See this stack overflow answer: python - What's the bad magic number error? - Stack Overflow

Can you upgrade your python version? I am pretty sure that is the issue

1 Like

Yeah try it with 3.7

Upgraded to 3.7.5 and that took care of the bad magic number error.

But have another error now. When I try the modem signal command it now says “Unable to detect a useable serial port”. Looking in /dev looks like the modem is showing up as ttyUSB0 and/or ttyUSB1 (they both go away when the modem is removed and come back when reinserted).

Make sure to stop any Ubuntu modem managers or network managers that may be running. They try to take over the port

That worked.

It returned a “Signal strength: 23,99”

Thank you!

1 Like

I was using a Verizon SIM card (the red led was on indicating an active data session and returned the signal strength 23,99) but decided to switch to the Hologram SIM card I have and I have no active data session and no signal strength (99, 99). I then tried switching back to the Verizon SIM card and the red LED is no longer on but it still returns a signal strength of 23,99. Should I have not switched SIM cards?

It’s probably needing to rescan for networks which can take a little while

I put the Verizon card back in and it’s been continuously powered for close to 30 minutes now, should it take this long? Shows signal strength of 23,99 but no operator and no red led on the modem. I tired sudo hologram network connect and I get ERROR: Modem hangup - possibly due to an unregistered SIM with both sim cards (Hologram and Verizon)

You can try doing an AT+COPS=? to do a full scan of available networks. Sometimes that kicks it into doing something.
It’s also possible that by putting the verizon card in there it added a bunch of the special verizon APN settings. You may need to use the AT+CGDCONT command to clear those out.