Advice for migrating current wifi project to cellular

I am a newbie working with Hologram. I have a running project now at a marina, where my raspberry pi is sitting on a boat taking a snapshot every 15 minutes, monitoring temperature, and gps location. The marina is removing wifi access and I would still like to have this monitor functional via Hologram.

My current setup is quite simple, a 15 minute cron job sFTPs the snapshop and data (in a zipped file) up to a web server I have, where another cron unzips and parses out the data using PHP. It works really well.

I’d like to see what the group thinks as to the least troublesome way to port this over to the Hologram network would be. Again, I am just learning so any information at all will be very helpful. Thanks!

Cell board hobbyist here, so not much experience with cell stuff like most folks here, but I saw your post and decided to experiment a little.

I took my Adafruit FONA 3G board, put my Hologram sim in it, and was able to ftp a simple text file to an account I have, and all went well. The text file was just a small 10 character file I quickly made/stored in the Simcom 5320 chip on the FONA board itself.

Then tested the same AT commands with a public FTP test site (FTP Test - DLP Test), here they are for reference:

AT+CGSOCKCONT=1,“IP”,“hologram”,“0.0.0.0”,0,0
AT+CFTPSERV=“ftp.dlptest.com
AT+CFTPUN=“dlpuser”
AT+CFTPPW=“rNrKYTX9g7z3RgJRmxWuGHbeu”
AT+CFTPPUTFILE=“test1.txt”,0

Hopefully, 5-10 seconds after that last AT command you get back:
+CFTPPUTFILE: 0

Then to check if your file is now there in the directory use this AT command:
AT+CFTPLIST="/"

Anyways, probably best to go with a 4G board (as who knows how long 3G will be around). I simply grabbed my FONA 3G board because that’s the first cell board I learned on and know it well.

I also have two 4G boards (links below if interested) I’ll also test with and update the post, but it will probably have to wait until after the weekend (working on taxes, ug):

Simcom 7600 board

Simcom 7000 board

Thank you, that is very helpful. I am unfamiliar with AT commands and will need to pick through and see how that works, but if you are able to ftp up to a server on the internet, that gives me hope I can do the same without doing a lot of re-writing!

I can help with the AT commands, I’ve built a couple arduino/cellular combo projects over the last year or so. AT commands do appear to be fairly similar between chips (my opinion of course), so that’s handy.

Although I have two Pi’s I’ve never tried to control another board with them, just turned them into NAS devices and/or also scraping some web pages with LibreOffice macros.

Am curious, I’m guessing the program mentioned in your first post is in python? I see on my Pi4 there’s a Thonny Python IDE … is that what you’re using?

Just a quick update with two websites for AT command related stuff I often use.

The first is a Simcom site for all their docs (AT and others) organized by chip number. Yes you’ll probably get a warning about the site (I do every time), but it’s the best source of Simcom info that I’ve found so far:

https://simcom.ee/documents/

And then this more general site I find handy from time to time, use the dropdown menu and pick the AT command you’re interested in…although it’s demonstrating their AT software the description and input/output examples sometimes gives more details than the Simcom manuals above.

https://m2msupport.net/m2msupport/at-command/

Thank you! That will be a big help. Yes, I am using Python currently to handle everything on the Pi end regarding the sensors.

Ok, was able to FTP a simple text file using the Simcom 7000 board I linked above.

Unfortunately, I was unable to create and save a test text file in the Sim7000 memory like I did for the Sim5320 above in the FONA, so I just typed 10 random characters as described below (btw using PuTTY to do all this). Also used the same public ftp test site mentioned above (and tested in my own account too).

Anyways, the AT commands were a little tricker for this board:

AT+SAPBR=3,1,“APN”,“hologram” (creates profile 1)
AT+FTPSERV=“ftp.dlptest.com
AT+FTPUN=“dlpuser”
AT+FTPPW=“rNrKYTX9g7z3RgJRmxWuGHbeu”
AT+SAPBR=1,1 (opens profile 1)
AT+FTPTYPE=“A”
AT+FTPPUTPATH="/"
AT+FTPPUTNAME=“test2.txt”
AT+FTPPUT=1 (opens session)
(wait a few seconds you should see: +FTPPUT: 1,1,1360)
AT+FTPPUT=2,10 (the 10 is for 10 characters)
(at this point just typed in 10 random characters)
(then should see +FTPPUT: 1,1,1360 again)
AT+FTPPUT=2,0 (closes session)

Then to see the FTP directory and see if the file is there:
AT+FTPGETPATH="/"
AT+FTPLIST=1
(wait a few seconds you should see: +FTPLIST: 1,1)
AT+FTPLIST=2,1024
(directory will print out)

Btw, in that simcom.ee doc site above, in the SIM7000x folder, is a super nice doc just focused on FTP stuff, ie, “SIM7000 Series FTP Application Note”. Between that and the 7000 AT Command Manual (in the same directory) I got the above working.

Ok, back to taxes.

Check out the Helium network, it uses LoRaWAN. I love Hologram…but just food for thought.

Hey Mark, if it helps any I figured out the Pi/Python/Sim7000 code. However, besides this being the first time I’ve coded in Python, I’m a lousy programmer to begin with, just wanted to warn you!

Ok, so below is the code that worked for me, using a Pi4, the Sim7000 board I linked above, and a hologram sim:

import serial
import time

ser = serial.Serial('/dev/ttyS0',9600,timeout=0)

def Sim7000_do(AT_command, tsec=0.1):
    AT_command = AT_command + "\r"
    ser.write(AT_command.encode())
    time.sleep(tsec)
    while (ser.inWaiting() > 0):
        print(ser.readline().strip())
    print()
    
def Sim7000_data(the_data, tsec=0.1):
    print(the_data)
    ser.write(the_data.encode())
    time.sleep(tsec)
    while (ser.inWaiting() > 0):
        print(ser.readline().strip())
    print()

print("running...")
print()

Sim7000_do("ATE1") #echo on

Sim7000_do("AT+CREG?") #see if registered, 0,5?

Sim7000_do("AT+SAPBR=3,1,\"APN\",\"hologram\"") #set access point name
Sim7000_do("AT+SAPBR=1,1") #open profile 1 above
Sim7000_do("AT+SAPBR=2,1") #check if profile ok, ip address?

Sim7000_do("AT+FTPSERV=\"ftp.servername.com\"") #ftp url                  
Sim7000_do("AT+FTPUN=\"ftp_id\"") #id
Sim7000_do("AT+FTPPW=\"ftp_pw\"") #pw

Sim7000_do("AT+FTPTYPE=\"A\"") #text mode
Sim7000_do("AT+FTPPUTPATH=\"/\"") #path on server
Sim7000_do("AT+FTPPUTNAME=\"data1.txt\"") #name on server

Sim7000_do("AT+FTPPUT=1",5) #open ftp session, wait 5 seconds
Sim7000_do("AT+FTPPUT=2,10",5) #will send 10 char of data, wait

datastring="yabbadabba" #data
Sim7000_data(datastring,5) #send data, wait again

Sim7000_do("AT+FTPPUT=2,0",5) #close ftp session, wait

Sim7000_do("AT+SAPBR=0,1") #close profile 1

Again, as mentioned above, I’m not a good programmer in any language!! Ran this about a dozen times, changing that data string and checking my account afterwards, all good.

btw, I did initially have problems with different baud rates between the program and the board, just look at AT+IPR in the AT manual. Can also give you more detail if needed.

Also, you might be interested in this Sim7000 hat I found for a raspberry pi:

Sim7000G Pi Hat

Would make for a much nicer setup than the board I used above. Ordered one for myself, thinking of making of hotspot with it, fun stuff!

Thank you! You are a rock star! I’m going to try this out in my test environment!

Mark

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