Waveshare 8202G 5G HAT not working with Pi 4B

Hi, first time user to this forum so I apologise if I format things incorrectly.

I recently ordered and received a Waveshare 8202G 5G HAT that I am intending to connect to my Raspberry Pi 4B. The Pi 4B is running Buster dated 4-4-2022, 32-bit. I believe I have connected the 5G HAT correctly to the Pi via the GPIO connector and via the USB-to-USB connector. If I connect the power supply that came with the 5G HAT to the 5G HAT then the PWR and NET lights come on, and the fan spins, however the Pi 4B does not boot up. I have already enabled the I2C and Serial Port too in the bios of the Pi. If I don’t connect power via the 5G HAT but instead connect my Pi power cord to the Pi 4B then the Pi 4B will boot up, however neither the 5G HAT PWR or NET lights come on and neither does the fan spin. I think this is an issue. I also have a separate Pi 4B configured with the Waveshare 7600 4G HAT and this works fine ie. power to the Pi and the lights PWR and NET lights come on on the 4G HAT. Thus - my question is should I be seeing the PWR and NET lights come on on the 5G HAT when I use power to the Pi 4B ?

The second issue is when I try and setup the software for the 5G HAT as per the instructions on the Wavesare wiki link, the setup is failing. The wiki link suggests you need to enter the following commands in a terminal window:

sudo apt-get install p7zip-full
wget https://www.waveshare.com/w/upload/f/fb/SIM8200-M2_5G_HAT_code.7z
7z x SIM8200-M2_5G_HAT_code.7z
sudo chmod 777 -R SIM8200-M2_5G_HAT_code
cd SIM8200-M2_5G_HAT_code
sudo ./install.sh

When I enter the 4th command above, ie. :

sudo chmod 777 -R SIM8200-M2_5G_HAT_code 

i get a response back on the command line saying

chmod: cannot access 'SIM8200-M2_5G_HAT_code': No such file or directory

And as a consequence no other commands after this are valid.

Again, just for clarity, my thinking is if I can get the software/code installed then maybe this might cause the 5G HAT to kick into life (am secretly hoping), if not then the conclusion i am coming to is the 5G HAT must be faulty.

Ideally I need to get this working as it was supposed to be part of a demo i am doing in 3 weeks at an industry event with thousands of people… Help!

2 Likes

Hi James,

We don’t have another 5G HAT in the warehouse today that we can compare with, but we’ve got another unit on its way at the moment.

Looking at Waveshare’s specs for the 5G HAT it isn’t clear if the included power supply is intended to supply the HAT and Pi together. It might be worth trying to power your HAT and Pi both with their own independent power supplies and see if it’s simply running out of juice.

Confirming the power supply is adequate is always step 0 for these things as everything else is dependent. Let us know your results with that configuration then we can look further into why the code is throwing errors.

1 Like

Hi James,

Welcome :smiley: Everything has come through alright! (You can also comment on a specific product, I’ll pop instructions down below).

To add to Trent’s reply, I had a look around the schematic and PCB and it seems like Waveshare has left both supplies separated (bridging this at home might be a bit tough, and could introduce some faults elsewhere - if using 2 separate supplies work I’d stick with that for the demo at least!)



(Excuse the bad drawing)

To confirm that the HAT is working you could also try the PC instructions.

Let us know how you go with both power supplies!
Liam

1 Like

Hi Trent & Liam, ok I now have both power supplies plugged in (one to the Pi 4B and the other to the 5G 8202G HAT)… the lights are on both the Pi and the HAT so thats a positive (and the fan is spinning)… however when trying to install the code as per the waveshare instructions it’s still failing at the sudo chmod 777 -R SIM8200-M2_5G_HAT_code command (as described above). :slight_smile: James

2 Likes

I issued an ifconfig -a command as it suggests doing that on waveshares wiki for te 8202G and I get the following information displayed for wwan0:

wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xxx.xxx.xxx.xxx netmask 255.255.0.0  broadcast xxx.xxx.xxx.xxx
        inet6 <ipv6 address>  prefixlen 64  scopeid 0x20<link>
        ether <ipv6 address>  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I am not sure if this is of any use?

2 Likes

Hi James,

Glad to hear both are lit up now!

Waveshare advises that a specific version of Buster should be used, were you running the 5.4 Kernel?

In regards to the chmod command failing, the cause will be that the files arent initally downloaded, are there any errors during:

wget https://www.waveshare.com/w/upload/f/fb/SIM8200-M2_5G_HAT_code.7z
7z x SIM8200-M2_5G_HAT_code.7z

I’m not too sure why the wwan interface is showing(most likely through the USB connection), though it is promising!
Liam

1 Like

Hi, apologies for the delay in writing back as I have been exploring a number of things.

  • Firstly, apologies as I don’t know what version of Kernel I am running and don’t know how to obtain it. All I can tell you is I am using Buster 32-bit dated 04-04-2022. Can you advise how I determine the kernel version.

  • I have now tried 3 separate Pi 4B’s with the Waveshare 8202G HAT and the waveshare instructions published on their wiki for the 8202G always fail at the chmod command [ sudo chmod 777 -R SIM8200-M2_5G_HAT_code] . I think waveshare should look at their code-package to check it is correct. When I follow these commands there are no apparent errors during the wget stage, first sign of any problem is at the chmod command. For clarity I am referring to these instructions on the waveshare wiki:

wget https://www.waveshare.com/w/upload/f/fb/SIM8200-M2_5G_HAT_code.7z
7z x SIM8200-M2_5G_HAT_M2code.7z
sudo chmod 777 -R SIM8200-M2_5G_HAT_code
cd SIM8200-M2_5G_HAT_code
sudo ./install.sh 
  • I’ve also noted something else that is interesting, which is when I have power going to the Pi and power going to the 5G 8202G HAT, the Pi is no longer able to access the internet (ie. no access to web pages and pings fail). Thus, i have to power down the 5G HAT to get an internet browser to then view the the instructions.

  • I also received advice from waveshare to use a different package / set of instructions (as I had logged a support ticket with them also initially) - they have since advised me to use this link to 820X NDIS ( SIM820X RNDIS Dial-Up - Waveshare Wiki ). This package seems to download and upack properly and looks like it might work. Interestingly it only gave an error on the last step as it couldn’t find the 8202G HAT as it was powered off, so I powered it on and tried it again and the last command worked. Here are the commands listed in the wiki:

wget https://www.waveshare.net/w/upload/1/1e/SIM820X_RNDIS.zip
sudo apt-get install python3-pip
sudo pip3 install pyserial
sudo apt-get install unzip
unzip  SIM820X_RNDIS.zip
sudo chmod 777 SIM820X_RNDIS.py
sudo python3 SIM820X_RNDIS.py

Attached is a screenshot of the the 820X NDIS package:

Attached is a screen capture showing my Pi configuration (ie. I do have the serial port enabled):
ScreenCapture_of_Pi_Cfg

Attached is the screen capture showing that I am unable to reach any website WHEN the 5G 8202G HAT is powered on (both before and after the installation of NDIS package):

Soooo, with all that said - I am not sure if the 5G HAT is now working following the installation of the NDIS package. I need to figure out the AT commands to test it (sorry this is outside my current skill set so i need to do some research)… However, if it means that by having the 5G HAT I am unable to access WIFI internet then I think this is a show stopper…

Side note: With my other Pi running a waveshare 7600 4G HAT I have internet access at the same time as 4G access… that unit works beautifully…

Thoughts??

1 Like

Hey James,

All that this command:

sudo chmod 777 -R SIM8200-M2_5G_HAT_code

Does is change the Unix file permission modifiers (i.e. CHange-MODifiers) (read-write-execute) to binary 111 for each user class (owner-group-other) i.e. 111111111

I noticed that you’re running all of these commands from your user’s home/ directory. To move around folders in a bash terminal you use cd <PATH-NAME> to change between directories (use cd .. to navigate up directories) and ls to list all of the files in your current directory (with ls -la you can see all files even if they’re hidden and all of the permissions associated with them)

I’d use this to check that you’re definitely in the right directory and all of the files with the right permissions exist where you expect them.

p.s. to check the kernel version from a BASH (bourne-again shell) terminal I’m fairly sure the executable you’re after is uname, to list the info you should be able to use: uname -a although I suspect that this isn’t the issue.

Thank You Bryce. I am sure I am navigating correctly up/down the O/S correctly.

The kernel version of my Pi’s are all above 5.14, they’re all at 5.15.XX, i’ve attached a screen shot of this one I am currently trying to get the 5G 8202G HAT working with.

I also followed the waveshare wiki to get the ipconfig information and do a ping test, here are the results:


(note: one of my earlier comments - for me to upload this post I actually have to power off the 5G 8202G HAT as it seems to interfere with my wifi on the Pi and prevent me from accessing the internet).

As this destination is unreachable, the waveshare information advises to do the following:

sudo dhclient -v usb0
sudo route add -net 0.0.0.0 usb0

This made no difference in that although the commands maybe did something (they did give any errors), the result was the same ie. address unreachable (for clarity the power to the HAT was turned on when I was trying to get this working, I just powered it off so that I could update this post).

So here I am - a week of trying to get this 8202G HAT to work and it doesn’t…

An offer : Would you like me to send you/Core Electronics the 8202G 5G HAT to see if you can get it to work???

Hi James,

We’ve just had one of these come in. We’re a little quiet today so we’ll see if we can get it setup and will get back to you soon!

1 Like

Hi, just an update from my end - waveshare have asked me to try the following although this is no use as I can’t get the drivers to install correctly. They also suggest upgrading the firmware, however the instructions on the site they gave are very sparse and i’d be worried about stuffing up my pi because of the brevity in waveshare instructions… Thus, I haven’t done these tasks yet but I wanted to share with you the feedback from waveshare… this is taking way too much time to try and get working… how are you guys going at Core Electronics - have you had any success with this particular 8202G 5G Hat?

Waveshare feedback/instructions:

1 Does the NET light flash?
2 After confirming that the hardware is OK, you can use the following command (AT LOG) to further confirm the network situation:

  • Check the firmware version information: AT+SIMCOMATI
  • Check if the sim card is in good contact: AT+CPIN?
  • Check whether the radio frequency is turned on: AT+CFUN?
  • Check if the network mode setting is correct: AT+CNMP?
  • Check the signal quality of the current environment: AT+CSQ
  • Check operator access: AT+COPS?
  • Check internet connection: AT+CPSI?
  • Check if the registration to the network is successful: AT+CGREG?

SIM820X-SIM7600X-NETWORK.png

  1. If it still doesn’t work, please update the firmware:
    https://note.youdao.com/s/XE2uA1VD

Hi, a further update. I have installed minicom and followed waveshares request to enter the AT commands and surprisingly the AT+CPIN? command is giving an error suggesting the SIM is not installed (+CME ERROR: SIM not inserted). Yet I have checked and my initial 5G SIM is seated correctly. I have since tried a second 5G working SIM (from my 5G router) and I get the same error and i’ve also tried my 4G SIM from my Waveshare SIM7600 - this too comes up with the same error. Now whilst I suspect it has nothing to do with the original driver installation issue, or the fact that I can’t have the 8202G HAT on and obtain a wifi connection reliably, it would seem to suggest there is some kind of hardware issue with the Waveshare 8202G HAT that I have.

Screen grab with a Telstra 5G SIM installed (correctly) - configured for voice+text+data

Screen grab with a Telstra 4G SIM installed (correctly) - configured for voice+text+data

Have you good folks at Core Electronics had any luck testing out the unit I think you said you had coming in???

Cheers James.

Woohoo ! Solved it !

So, I had some feedback from Waveshare on Friday evening that if SIM cards are not recognised (as per my previous entry) that this is because of the ‘feature’ (not documented) with this particular 8202G board. Some 8202G boards allow for 2 SIMs meaning you have a SIM 1 and a SIM 2. Apparently on some boards (ie. this one) which only has 1 SIM slot, the default setting is to look at SIM 2 (which it doesn’t have), hence why it fails to ever establish a network connection. Thus, by simply going into minicom and typing:

 AT+SMSIMCFG=1,1

fixes the issue. No sooner had I typed this and the beautiful little green network light started flashing…

Note: One additional step if the above didn’t work is apparently airplane mode could be enabled, in which case the advice is to type the following AT command into minicom:

AT+CFUN=1

The next step was then to install the RNDIS drivers from the following Waveshare wiki link:

https://www.waveshare.com/wiki/SIM820X_RNDIS_Dial-Up

Lastly (this is where I cheated a little bit), I used the .py files for SMS, TCP. etc from the SIM7600X package (the ones from Tim@Core Electronics awesome article on setting up the Waveshare SIM7600X 4G Hat) and copied those into the /home/pi/qmi_wwan_simcom folder and then when I ran these files in Thonny Python IDE they worked ! I can send SMS’s, connect via TCP… i’m a happy bunny (although it cost me a lot of wasted time over the past 2 weeks and a lot of frustration as I am sure you can imagine).

Next step, to install Azure IoT, re-setup my PiicoDev sensors and send the data over to Azure via 5G…

:slight_smile: :slight_smile: :slight_smile:

4 Likes