HackerBox 0048: SIMSAT

Greetings to HackerBox Hackers around the world! For HackerBox 0048, we are experimenting with programming ESP8266 WiFi microcontroller modules, GSM mobile/cellular communications for IoT, integrated GPS satellite positioning, multi-band antennas, coaxial RF adapters, and power supply considerations for embedded wireless communication systems.

This Instructable contains information for getting started with HackerBox 0048, which can be purchased here while supplies last. If you would like to receive a HackerBox like this right in your mailbox each month, please subscribe at HackerBoxes.com and join the revolution!

HackerBoxes is the monthly subscription box service for enthusiasts of electronics and computer technology - Hardware Hackers - The Dreamers of Dreams.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Content List for HackerBox 0048

  • WeMos D1 Mini Pro ESP8266 WiFi Module
  • SIM808 GSM and GPS Breakout Module
  • Soracom Cellular IoT SIM with $10 Credit
  • GSM Quadband SMA Antenna
  • GPS Antenna with 1m SMA Cable
  • Two SMA to uFL/IPX Coaxial Cables
  • MicroUSB Breakout Module
  • Three Black Mini Solderless Breadboards
  • Bundle of 65 Male Jumper Wires
  • Pentester Labs "Hack the Planet" Decal
  • Exclusive HackerBoxes Maker Decal

Some other things that will be helpful:

  • Soldering iron, solder, and basic soldering tools
  • Computer for running software tools

Most importantly, you will need a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.

There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we really appreciate your taking a few minutes to read the FAQ.

Step 2: WeMos D1 Mini Pro

The WeMos D1 Mini Pro is a mini WiFi module featuring 16MB flash, external antenna connector, and built-in ceramic antenna. The module is based on the ESP-8266EX system-on-chip (SOC).

Make the initial tests of the WeMos D1 Mini Pro before soldering the header pins onto the module.

Instal the Arduino IDE and the ESP8266 support package

Under tools>board, be sure to select the "WeMos D1 R1"

Load the example code at Files>Examples>Basics>Blink and program it to the WeMos D1 Mini Pro

The example program should cause the blue LED on the module to blink. Experiment with modifying the delay parameters to make the LED blink with different patterns. This is always a good exercise to build confidence in programming a new microcontroller module.

Once you are comfortable with the module's operation and how to program it, carefully solder the two rows of header pins into place.

Step 3: Satellite Positioning

Satnav systems use satellites to provide autonomous geo-spatial positioning. They allow small electronic receivers to determine their location (longitude, latitude, and altitude/elevation) to high precision (within a few centimeters to metres) using time signals transmitted along a line of sight by radio from satellites. As of October 2018, the United States' Global Positioning System (GPS) and Russia's Global Navigation Satellite System (GLONASS) are fully operational global navigation satellite systems (GNSS). China's BeiDou Navigation Satellite System (BDS) and the European Union's Galileo are scheduled to be fully operational by 2020. Japan's Quasi-Zenith Satellite System (QZSS) is a GPS satellite-based augmentation system to enhance GPS's accuracy, with satellite navigation independent of GPS scheduled for 2023. Global coverage for each system is generally achieved by a satellite constellation of 18–30 medium Earth orbit (MEO) satellites spread between several orbital planes. (Wikipedia)

Step 4: SIM808 Breakout Module

The SIM808 module is a combined GPS receiver and GSM cellular/mobile transceiver. (Datasheet)

In this step, we will enable and explore the GPS receiver functionality.

WIRING: As shown, the SIM808 is wired to the serial port of the WeMos D1 Mini (or most any microcontroller) using three lines: RX, TX, and GND. The pins in the diagram correspond to the same code below. The 5V Power and Ground can be supplied from any high quality USB power bank or adapter using the included MicroUSB breakout. A bench power supply or similar supply can also be used. Do not try to power the SIM808 from the WeMos D1 Mini.

ANTENNA: Connect the GPS Antenna via its 1m SMA ccable to one of the SMA to uFL/IPX coaxial adapter cables. Connect the uFL/IPX end of the adapter cable to the coaxial connector on the SIM808 module marked GPS.

SATELLITES: Power up the SIM808 with the GPS Antenna connected. The RED LED (power) will come on. After a couple of minutes four (or more) GPS satellites should be acquired and the BLUE LED on the SIM808 will start blinking slowly.

SAMPLE CODE: Use the Arduino IDE to program the GPSdemo.ino example code into the WeMos D1 Mini. The Arduino Serial Monitor can be used to observe the time and position information determined by the GPS receiver. For example:

"1,1,20191001155512.000,36.118994,-115.167543,119.400,1.06,94.9,1,,1.1,1.4,0.8,,7,7,,,39,,"

Note that the field starting with the year (for example, 2019) can be broken down as a date/time stamp (in UTC). The next two fields are latitude and longitude. These can be pasted into a google search box for mapping to verify your location. Test the lat/long in the example string above for a map to DEF CON 28 in August 2020.

Step 5: SORACOM Cellular IoT SIM

The Soracom IoT SIM is designed for IoT devices, development and deployment at scale. Featuring commitment-free, pay-as-you-go pricing and multi-carrier connectivity in over 130 countries. Available in a full range of SIM and eSIM form factors, with service across 2G, 3G, 4G LTE and Cat M1 bands (where available).

TEN DOLLAR CREDIT: The included Soracom IoT SIM includes a $10 data credit for initial experimentation.

SIM SIZE FORMAT: As shown in the image, the Soracom SIM Card includes an all-in-one or three-way SIM, the SIM808 modules requires he Micro SIM format so be careful not to pop out the Nano SIM outline.

SORACOM LINKS:

Soracom Registration Video

Soracom Developer Documentation

ANTENNA: The "Rubber Duckie" GSM Quadband SMA Antenna can be connected to the SIM808 coax port marked GSM using the second SMA to uFL/IPX Coaxial Adapter Cable.

EXAMPLE GSM CODE:TinyGSM, SIM808 Tracker, SnortTracker

Step 6: Satellite Internet - Coming Soon

Satellites can do a lot more than tell us where we are. The next era of satellite internet will be the result of a race to deliver affordable high-speed, low-latency internet. Several well-funded organizations have already begun launching satellites and more have launches scheduled soon. Satelliteinternet.com takes a look at those networks and the companies building them.

Step 7: Hack the Planet

We hope you are enjoying this month's HackerBox adventure into electronics and computer technology. Reach out and share your success in the comments below or on the HackerBoxes Facebook Group. Also, remember that you can email support@hackerboxes.com anytime if you have a question or need some help.

What's Next? Join the revolution. Live the HackLife. Get a cool box of hackable gear delivered right to your mailbox each month. Surf over to HackerBoxes.com and sign up for your monthly HackerBox subscription.

4 People Made This Project!

Recommendations

  • Instrument Contest

    Instrument Contest
  • Make it Glow Contest

    Make it Glow Contest
  • STEM Contest

    STEM Contest

31 Discussions

0
None
seaprimate

Question 4 weeks ago

I'm not familiar with using SIM cards for arduino IoT. I've created an account on the sora.io website and registered the chip on my consule To get the card to go from 'ready' to 'active' is it some code I put into the WeMos D1, or do I need to activate it using another device first? Thanks!

13 answers
0
None
misterfishseaprimate

Answer 4 weeks ago

I watched many videos trying to learn, and happened across this one:

His library of sketches is at http://www.iforce2d.net/sketches/, the one that I specifically grabbed was www.iforce2d.net/sketches/sim808GPSTracker.zip

In sim808.h, change line 348 to read
sendGSM("AT+SAPBR=3,1,\"APN\",\"soracom.io\"");

Power everything on, open the serial monitor, and a loooong time for the GPS to get a lock. Once it does, the sketch will move to the "upload my GPS coords" stage. Now wait even longer, and eventually your console.soracom.io SIM status will switch from Active/Offline to Active/Online.

I never did get my location to appear on his practice map page, but I can see in the monitor that my data is being sent, so that's something. At least I know the hardware is active and working.

0
None
jdquaffmisterfish

Reply 15 days ago

Actually, give it a try now! I contacted the creator on YouTube, and there was an issue server side - I tried, and through no further effort of my own points started plotting!

0
None
TimGTechjdquaff

Reply 3 days ago

Did you use the includd .ino sketch with the library and if so, did you have to make any modificaions to it? Thanks :)

0
None
jdquaffTimGTech

Reply 3 days ago

I had to make two modifications: change the journey code (your unique identifier) and then replaced their APN login information Soracom’s

0
None
TimGTechjdquaff

Reply 3 days ago

Thanks jdquaff! I'm gonna play with it more this weekend. I'll post back here with my results.

0
None
misterfishTimGTech

Reply 2 days ago

It does work now, though on one trip it just stopped after about 20 mins, no new points were uploaded. I didn't know until I got back, of course, and no logs, so can't say what happened.

0
None
jdquaffmisterfish

Reply 20 hours ago

Actually, I just remembered my first time using the same thing happened. I think by default the URL only pulls up a set number of points, so add at the end &lt=10000 or some other absurdly high number to get all of your data.

0
None
jdquaffmisterfish

Reply 2 days ago

Same thing happens to me sometimes - not sure what the issue is, but the lights flash on the SIM808 so I’m not sure what’s going on.

When it does work, it records a point every 10 seconds. I’ve never had it not work spontaneously, but sometimes on startup

0
None
jdquaffmisterfish

Reply 15 days ago

Hey there,

I am at the same point as you I think. I wasn’t seeing any updates on the map site, realized that I hadn’t signed into the APN, edited the code and STILL can’t get the GPS points posted on the site - but at least my SIM card is online.

Did you ever manage to get your journeys to upload on the site? Just curious; I sent an email to the video creator.

0
None
Racer1TNmisterfish

Reply 4 weeks ago

Your link to the url and the sketches is broken, server not found.

0
None
misterfishRacer1TN

Reply 4 weeks ago

The links somehow include the comma and period. Click the links, delete the trailing comma/period.

Edit: Fixed the links.

0
None
mrGman123

21 hours ago

Ok, so I'm trying to get the GPS side of things working. I haven't moved on to the SIM card.
I was able to get the program loaded however the green LED is flashing I never get the Blue LED indicating a successful link to satellites. My lab is in my man cave (basement). I took it outside hoping to see it connect. Nothing! no link. I do live in Michigan and this time of year it is very cloudy but today I could see some patchy blue ski so I thought this would be my best shot for now. Wrong. What am I missing? below is my successful load.

esptool.py v2.8
Serial port COM9
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:xx:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
WARNING: Suspicious segment 0xee, length 0
WARNING: Suspicious segment 0x0, length 16777216
Warning: Image file at 0x0 is not a valid ESP8266 image, so not changing any flash settings.
Compressed 269888 bytes to 115611...
Writing at 0x00000000... (12 %)
Writing at 0x00004000... (25 %)
Writing at 0x00008000... (37 %)
Writing at 0x0000c000... (50 %)
Writing at 0x00010000... (62 %)
Writing at 0x00014000... (75 %)
Writing at 0x00018000... (87 %)
Writing at 0x0001c000... (100 %)
Wrote 269888 bytes (115611 compressed) at 0x00000000 in 3.1 seconds (effective 689.5 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...

0
None
AlbinM5

Question 8 days ago

Whenever a sim is inserted into the SIM808 module, it will always periodically restart (approximately 10 secs between each reboot)
I tried powering it with different power supplies and my lapbench powersupply, but still keeps on rebooting

0
None
Happe Hippo

9 days ago

I waited for 10 minutes to get the GPS to connect. It didn't - light stayed red. I pulled the antenna off to check the connection. Antenna connection came off board. Nice. Is there a trick to getting these on and off? Anyway, that is that and the stuff is in the trash now.

0
None
MikeM551

20 days ago

Stumped following the procedure above with this softwareserial.h error upon compile..

Board: "WeMos D1 R2"

beginning of error list:
In file included from C:\Users\Mike\Documents\Arduino\libraries\EspSoftwareSerial\src/SoftwareSerial.h:27:0,

from C:\Users\Mike\Documents\Arduino\WEMOSD1R2Pro_GPS\WEMOSD1R2Pro_GPS.ino:1:

and such Multiple libraries were found for "SoftwareSerial.h"

.. ending with
exit status 1
no matching function for call to 'SoftwareSerial::SoftwareSerial(const uint8_t&, const uint8_t&)'

arrgh


I deleted the 8266 folder and reloaded with the board manager as described by TimGTech

exact same result.

Compiling for flashing LED test was fine.

Any other ideas for this Arduino board manager install??

It is working now ( I would still like a solution using the instructions above)

I did a GIT Clone ( new boards show up) and compiled using :


Board: "LOLIN(WEMOS) D1 R2 & mini"

instructions here:

https://arduino-esp8266.readthedocs.io/en/latest/i.io/en/latest/installing.html#using-git-version

So.. while not really a hack, it is working as intended.

tail of flash sequence:


esptool.py v2.8
Serial port COM5
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 272176 bytes to 197956...

...
Writing at 0x0002c000... (92 %)
Writing at 0x00030000... (100 %)
Wrote 272176 bytes (197956 compressed) at 0x00000000 in 5.0 seconds (effective 439.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Thanks, Please let me know about any board manager tricks... would still like to see what I am not seeing !!

That is the one thing about Hacker Boxes... it really makes you think.... will continue to figure out this board manager SoftwareSerial problem.

Mike

0
None
Rorroh

Question 23 days ago on Step 4

Similar to dmorash, I'm having an error during compilation. Also, I haven't had a blue light show up on my module after the couple hours trying to resolve this issue.

Multiple libraries were found for "SoftwareSerial.h"
Used: C:\Users\Rorroh\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.0\libraries\SoftwareSerial
exit status 1
no matching function for call to 'SoftwareSerial::SoftwareSerial(const uint8_t&, const uint8_t&)'

Looking at the SoftwareSerial.h code, it seems that there's been a change between versions that is not documented despite being rather large, moving the rx and tx to the "begin" call instead. However, after doing so I get the following error:

Multiple libraries were found for "SoftwareSerial.h"
Used: C:\Users\Rorroh\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.0\libraries\SoftwareSerial
exit status 1
request for member 'begin' in 'sim808', which is of non-class type 'SoftwareSerial()'

If anyone could assist it would be greatly appreciated!

1 answer
1
None
TimGTechRorroh

Answer 23 days ago

I ran into a similar problem in the past and what I did was go into the C:\Users\You\AppData\Local\Arduino15\packages and delete the esp8266 directory completely. The reinstall the board using the board URL in he bard manager.