Setting Up Blues Wireless Notecard as GPS Tracker

Features

  • No coding needed.
  • No external microcontroller needed.
  • No IDE needed.
  • Send GPS data to the internet in minutes.

Hardware

Note: Legacy hardware may not be available to purchase at the Blues website. It is recommended to use the latest versions.

Also, it is important to choose the correct Blues Wireless Notecard that your cellular service provider supports.

Here is a table to decode the SKU of the Notecard.

So, for my Blues Wireless Notecard NOTE-NBGL-500, the decoded SKU is below.

  • NB = Narroband (LTE-M/NB-IoT)
  • GL = Global

In my country, the Philippines, my cellular service provider, Globe Telecom, supports LTE-M. So, NOTE-NBGL-500 should work.

Blues Wireless Notecarrier Embedded Sim

The Blues Wireless Notecarrier has an MFF2 UICC embedded SIM. It is soldered directly on the board. It works like a traditional SIM card. It has a 10-year data plan with 500 MB of cellular data. However, your cellular provider needs to be supported by the embedded SIM . You can find the list of supported countries at your Notecard datasheet. The list can change over time.

Supported Countries (not all shown):

Not Supported Countries:

My country, the Philippines, is not supported. So, I would need to use an external SIM card.

External SIM Card Requirements:

  • Subscribed to cellular data service.
  • Cellular service provider Access Point Nam (APN).

My cellular service provider is Globe Network. They provide two types of SIM cards. Which are postpaid or prepaid SIM cards. Postpaid SIM cards are already subscribed to cellular data service. You need to pay for that service monthly. What I have is prepaid SIM card. As is, I can call and send text messages. I would need to send a code text message to my cellular provider to subscribe to the cellular data service.

I searched the internet, and my cellular service provider, Globe Networks LTE APN, is http.globe.com.ph.

After subscribing to cellular data service, I connect my micro SIM card to the micro SIM card slot of Notecarrier A.

Then, I connect the Blues Wireless Notecard Cellular and Notecarrier A to my PC using a USB connection.

Notehub.io Set Up

Follow the Notecard Quickstart Guide to set up Notehub.io. Save the product UID to a notepad.

Using the Blues Wireless CLI, you can use the command below to verify your Notecard firmware version.

{“req”:”card.version”}

If your Notecard firmware is not the latest, it is recommended to update it to the latest version. You can update the Notecard firmware from Notehub.

Updating the Notecard Cellular firmware took a while to finish. You can see the firmware update activities at the CLI by using the command “trace”. To disable the trace mode use the command “trace off”.

Copy your device ID to a notepad. This will be needed at Datacake.

Datacake Set Up

Datacake is a multi-purpose, low-code IoT platform. For visual representation of a GPS tracker, we need to use the Datacake map widget.

Create a new Datacake account, then select “Add Device”.

Select “API”, then select “Next”.

Select “New Product from Template”, then select “Blues Wireless Notecard”. Select “Next”.

Input your device ID at “SERIAL NUMBER”. Input a device name. Then, select “Next”.

You need to choose a billed plan. For this project, I choose “Free”. After, choosing a plan, you will be re-directed to your workspace.

Select, your device. A pre-made dashboard will open, that we can use.

What we need to do next is route data from Notehub to the Datacake dashboard. Go to “Configuration” and copy the HTTP endpoint URL.

Routing Data from Notehub to Datacake

From your Notehub, select “Routes”. Then select “Create Route”.

Select “General HTTP/HTTPS Request/Response”.

Set a “Route name”. Then paste the Datacake HTTP endpoint URL. Select “Create Route”.

Blues Wireless Notecard Asset Tracker Set-Up

Using the Blues Wireless CLI, I will input these commands below to set up the Blues Wireless Notecard to function as a GPS tracker or an asset tracker.

See, Blues Wireless Notecard Walkthrough -> Essential Requests.

{“req”:”hub.set”, “product”:”your_product_uid”, “mode”: “periodic”, “outbound”: 5}

See, Blues Wireless Notecard Guides -> Using External SIM Cards.

{“req”: “card.wireless”, “apn”: “http.globe.com.ph”}

See, Blues Wireless Time & Location Requests -> Working with GPS on the Notecard.

{“req”: “card.location.mode”, “mode”: “periodic”, “seconds”: 60}

{“req”: “card.location.track”, “start”: true}

Important reminders:

  • The GPS will only work if there is a cellular connection.
  • Setting the card.location.mode to periodic, reads GPS data when there is movement.
  • GPS works if there is a line of sight between several GPS satellites and the receiver. So, if you are in a building, it would be difficult to get GPS data.

Encountering Cellular and GPS issues:

Powering the Notecard and Notecarrier

Here is the picture at the top with the external SIM Card.

I used 3 x AA batteries to power the Notecard and Notecarrier.

Testing the Blues Wireless GPS Tracker

I placed the Notecard and Notecarrier in a box. Then, I walked around my area for 23 minutes.

I got home and checked Notehub. There is only one _track.qo file.

I opened the _track.qo file and checked the JSON contents. I see, one GPS coordinates for the Notecard. I also, see one GPS coordinates for the cell tower.

To route the GPS data to Datacake select “Route Event”. Then, select the route you created.

Select your device at Datacake to open the dashboard.

The grey box with the red X is my house. I walked for 23 minutes around the area and then returned to my house. The Datacake map shows one GPS coordinates for the device. Also one GPS coordinates for the cell tower.

Maybe there is a Notecard set up that will enable it to send GPS data to Notehub more frequently. But, from what I have read, the Notecard firmware operates in low power to conserve battery power. One such conditions is that it only reads GPS when there is a cellular connection. So, if more frequent GPS data is needed, then I would need to use an external GPS board connected to a host microcontroller.

Improving the Parameters

I suspect that there is a conflict going on with the time for the Notecard to connect to the cellular provider and the time for the Notecard to read the GPS. I doubled the outbound and seconds from previous test.

{“req”:”hub.set”, “product”:”your_product_uid”, “mode”: “periodic”, “outbound”: 10}
{“req”: “card.wireless”, “apn”: “http.globe.com.ph”}
{“req”: “card.location.mode”, “mode”: “periodic”, “seconds”: 120}
{“req”: “card.location.track”, “start”: true}

I tested for about 30 minutes and I got three _track.qo files at Notehub.

Here are the three _track.qo files GPS coordinates.

First _track.qo:

“best_location_type”: “gps”,
“best_location_when”: 1740956303,
“best_lat”: 14.406422500000001,
“best_lon”: 120.96319140625,
“best_location”: “Imus”,
“best_country”: “PH”,

Second _track.qo:

“best_location_type”: “gps”,
“best_location_when”: 1740956313,
“best_lat”: 14.406522500000001,
“best_lon”: 120.96337890625,
“best_location”: “Imus”,
“best_country”: “PH”,

Third _track.qo:

“best_location_type”: “gps”,
“best_location_when”: 1740956319,
“best_lat”: 14.406547499999999,
“best_lon”: 120.96345703125,
“best_location”: “Imus”,
“best_country”: “PH”,

The Datacake map widget is unable to display in detail the three GPS coordinates. So, I used Google Maps to plot the GPS coordinates.

Google Maps GPS Coordinates

The distance covered, I assume to be 30 meters. Since, the outbound is set to 10 minutes. What factors that sends the GPS data to Notehub is still to be determined.

Buy Me a Coffee at ko-fi.com

Getting Started with BeagleBone Black in 2025

Chipset Features:

  • 1GHz ARM® Cortex-A8.
  • SGX 3D Graphics Engine.
  • NEON floating-point accelerator.
  • 2×32-bit 200-MHz programmable real-time units (PRUs).

Board Features:

  • SDRAM: 512MB DDR3L 800MHZ.
  • Onboard Flash: 4GB, 8bit Embedded MMC (eMMC).
  • SD/MMC Connector for microSD.
  • Power management:TPS65217C PMIC is used along with a separate LDO to provide power to the system.
  • Debug Support: Optional Onboard 20-pin CTI JTAG, Serial Header
  • Power Source: miniUSB USB or DC Jack.
  • High speed USB 2.0 Client port: Access to USB0, Client mode via miniUSB.
  • High Speed USB 2.0 Host port: Access to USB1, Type A Socket, 500mA LS/FS/HS.
  • Serial Port: UART0 access via 6 pin 3.3V TTL Header. Header is populated.
  • 10/100M Ethernet (RJ45).
  • Reset Button.
  • Boot Button.
  • Power Button.
  • LED power indicator.
  • 4 user configurable LEDs.
  • HDMI D type interface.
  • LCD interface.
  • Stereo audio over HDMI interface.
  • Expansion Interfaces via 2x 46 pin headers LCD, UART, eMMC ADC, I2C, SPI, PWM.

Expansion Connector Pinout:

Refer to this link.

Introduction

The BeagleBone Black was released more than 10 years ago. Back then, the first-generation Raspberry Pi Model B was also released. Comparing the two boards, the distinct advantage of BeagleBone Black is that it has more I/Os and has 1.8V analog inputs.

If you have a project or product development that requires more than what a microcontroller can do, then you have to use a processor. What is available to use with processors are single board computers, or SBC such as the BeagleBone Black.

Although, BeagleBone Black has been released more than 10 years ago, it is still available today and being used in projects and product development.

One advantage of BeagleBone Black is that is open source and everything is free to use.

With the advancement of technology from 10 years ago, we now live in a Windows 11 world. You can now use Linux running on a Windows 11 PC. Back then, you would need a separate computer to run Linux.

BeagleBone Black Development Requirements

Minimal Requirements:

  • BeagleBone Black.
  • USB Type A to USB mini cable.
  • Ethernet cable.

Standalone Requirements:

  • BeagleBone Black.
  • USB Type A to USB mini cable.
  • Ethernet cable.
  • HDMI LCD Monitor.
  • HDMI to mini HDMI cable.
  • USB hub.
  • USB keyboard
  • USB mouse.
  • 5V DC 1A power supply.

BeagleBone Black Setup Minimal Requirements

At the moment, I do not have all the requirements to start developing with the BeagleBone Black standalone. What I have available is what are required for minimal requirements.

Connect the BeagleBone Black to your PC using the USB Type A to USB mini cable.

Once connected the BeagleBone Black will appear as an external drive at your PC.

Go to BeagleBone Getting Started (D:) -> Drivers -> Windows and select BONE_D64.exe.

Start the BeagleBone Black Driver installer by selecting “Next”.

The installation will fail. At old Windows versions this would probably work, but not Windows 11.

Go to Windows 11 Start -> Settings -> Windows Update -> Advanced Options -> Recovery -> Advanced Startup and select “Restart Now”.

After restarting select “Troubleshoot”

At Troubleshoot select “Advanced Options”.

At Advanced Options select “Startup Settings”.

At Startup Settings select “Restart”. This will restart your PC.

Press “F7” to disable driver signature enforcement. Your PC will then restart.

Go back to BeagleBone Getting Started (D:) -> Drivers -> Windows and select BONE_D64.exe. The drivers will be installed successfully. The drivers installed is for you to access the BeagleBone Black using USB connection

Go back to BeagleBone Getting Started (D:) and open START.htm. According to START.htm BeagleBone Getting Started Guide, after installing the drivers you can now launch the website at IP address http://192.168.7.2. I clicked and it opened at Google Chrome.

This is the http://192.168.7.2 webpage. This is not a webpage running on the internet. But a webpage that is opened from the BeagleBone Black. You can try some activities on the webpage, like the interactive guide shown below.

Going down the website mention the use of Cloud9 IDE. However, clicking the Cloud 9 IDE link leads to Amazon AWS Cloud9 website.

To launch the Cloud 9 IDE, at your web browser type this http://192.168.7.2:3000/ at your address bar. Cloud 9 IDE will open. This is running on the BeagleBone Black.

After opening Cloud 9 IDE, I can’t do anything with it. I read in the Stack Overflow forum that it is End-of-Line (EOL). Basically, it is useless.

What we need to do is get the Ethernet IP address so we can access the BeagleBone Black using an Ethernet connection.

Remove power to BeagleBone Black by removing the USB cable. Connect your BeagleBone Black to your router using Ethernet cable. Connect the USB cable to power on the BeagleBone Black.

Open a SSH client for Windows. What I have installed is Tera Term. If you have Putty installed you can also use it.

At Tera Term TCP/IP enter the BeagleBone Black IP address 192.168.7.2. Then press “OK”.

Enter User Name “root”. Leave the Passphrase blank. Then press “OK”.

You can now send Linux commands to BeagleBone Black using Tera Term.

Enter “ifconfig” to show the BeagleBoneBlack interfaces. The Ethernet IP address of my BeagleBone Black is 192.168.254.105. Save this to a notepad. We will try to access the BeagleBone Black Ethernet IP address at another time.

Create Your First Python Program at BeagleBone Black using Nano

Nano is a simple command-line text editor commonly found in Unix-based operating systems.

Buy Me a Coffee at ko-fi.com

Fruit Ripeness Detection using Seeed Studio XIAO ESP32S3 Sense Camera and Edge Impulse Machine Learning

For this project I am going to use Machine Learning to determine whether a tomato fruit is ripe or unripe.

Machine Learning Workflow Diagram

Here is Machine Learning workflow diagram by Edge Impulse.

Machine Learning – Data Collection

The first step is to collect data that will be used to train algorithms. To determine fruit ripeness, we are going to need pictures of ripe tomatoes and unripe tomatoes. So, I went to the market and bought ripe and unripe tomatoes.

Edge Device

To collect ripe and unripe tomato pictures, I am going to use Seeed Studio XIAO ESP32S3 Sense, which includes a camera sensor. Using the same camera to collect pictures of ripe and unripe tomatoes will provide more accurate results.

The above picture shows the Seeed Studio XIAO ESP32S3 Sense with the camera sensor and antenna. This is referred to as the Edge Device based on the Machine Learning workflow diagram by Edge Impulse.

There are two methods to collect pictures of ripe and unripe tomatoes using Seed Studio XIAO ESP32S3 Sense. The first method is to save the pictures to the SD card. The second method is to save the pictures real time using camera web server example program. For convenience I am going to use the camera web server example program to collect pictures of ripe and unripe tomatoes.

Arduino IDE Requirements

At the time of this writing, I am using Arduino IDE 2.3.4.

Add ESP32 board package to Arduino IDE. Go to File -> Preferences, and fill “Additional Boards Manager URLs” with the url below: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Open the Boards Manager by going to Tools->Board Manager. Type ESP32 at the search bar. Select, version 3.0.7 and install. ESP32 version greater that 3.0.7 have issues with camera web server example program that works with Seeed Studio XIAO ESP32S3 Sense.

Go to Tools->Boards->ESP32 and select XIAO_ESP32S3.

Camera Web Server Modifications

Go to Files->Examples->ESP32->Camera and select CameraWebServer example program.

Set define CAMERA_MODEL_XIAO_ESP32S3.

Set your WiFi router credentials.

At app_httpd.cpp comment out lines 1389 and 1390.

Go to Tool->PSRAM and select OPI PSRAM.

Upload the modified CameraWebServer to Seeed Studio XIAO ESP32S3S Sense.

Go to Tools and open Serial Monitor.

Copy the http link. The link will only work if your PC is connected to your router using WiFi connectivity. Paste the link to your web browser. You can take pictures by selecting “Get Still”.

Tomato Pictures Collection

Here is my setup for taking pictures of ripe and unripe tomatoes.

I take 20 pictures of ripe tomatoes and 20 pictures of unripe tomatoes.

Every picture of the tomato needs to be in a different orientation. Here are the collected pictures of ripe and unripe tomatoes.

Edge Impulse – Create New Project

Create an account at Edge Impulse. A new project has already been made for you. You can rename it or change the description.

Edge Impulse -Data Acquisition

Go to data acquisition and upload the collected ripe and unripe tomato pictures.

There is an option to upload a file or folder.

I uploaded the folders Ripe_Tomato and Unripe_Tomato.

After uploading your first folder, you will be asked “Are you building an object detection project?”. Select, Yes.

Go to labeling queues. Set labeling queues for each picture of ripe and unripe tomatoes.

Edge Impulse – Impulse Design, Create Impulse

Go to Impulse Design -> Create Impulse. I set the Image Data parameters to default.

Add a processing block.

Add a learning block.

Select “Save Impulse”.

Edge Impulse – Impulse Design, Image

Go to Impulse Design->Image.

Since we need to mainly differentiate ripe and unripe tomatoes based on color, I set the Color Depth to default RGB. Select “Save parameters”. After select “Generate Features”. This will take a while to finish. After it is done you will see a feature explorer representing your collected data. A good separation of features, will mean that it can differentiate a picture with a ripe tomato and a picture with a unripe tomato.

Edge Impulse – Impulse Design, Object Detection.

Go to Impulse Design -> Object Detection and select “Save & train”.

This will take some time to finish. After the training is done, you will see training performance results. Here below shows a 100% F1 score. Meaning it can differentiate 100% differentiate between a picture with a ripe tomato and a picture with an unripe tomato.

Edge Impulse – Impulse Design, Deployment

Go to Impulse Design ->Deployment. There is an option below to change target. I change target to EPS32.

Select “Arduino Library”, then select “Build”. The built Arduino Library will be saved at your PC downloads folder.

Adding Arduino Library to Arduino IDE

Go to Sketch->Include Library->Add .ZIP Library. Select the built library from Edge Impulse.

Modifying the ESP32_camera program from the Imported Library

Open the esp32cam example program from the imported Edge Impulse Arduino Library. Go to File->Examples->Your Imported Library->esp32->esp32_camera

Set the define for CAMERA_MODEL_XIAO_ESP32S3.

Add the if define for CAMERA_MODEL_XIAO_ESP32S3. Enclosed are the CAMERA_MODEL_XIAO_ESP32S3 pins.

Upload the program to Seed Studio XIAO ESP32S3 Sense.

Video Demo

Buy Me a Coffee at ko-fi.com

Blues Wireless Notecard WiFi Sensor Network

Previously, I discussed how in just a short period of time I was able to send data to the internet using Blues Wireless WiFi Notecard.

Next steps: Connect a wireless sensor network to the Notecard WiFi and send sensor data from several sensor nodes to the Notehub.

Wireless Sensor Network

For the wireless sensor network I am going to use 1 x TI CC1352R1 Launchpad which will function as a collector. I am going to use 3 x TI LPSTK-CC1352R1 which will function as sensor nodes. The collector and sensor nodes will communicate using the Sub 1 GHz TI 15.4 Stack star topology.

Why Sub 1-Ghz?

TI LPSTK-CC1352R1 Dynamic Multi-Protocol Manager

The TI LPSTK-CC1352R1 sensor nodes run on an example program that operates a dynamic multi-protocol manager. The dynamic multi-protocol manager (DMM) allows multiple wireless stacks to coexist and operate concurrently on a single radio on a CC13xx or CC26xx device. The stacks that will coexist are the TI 15.4 stack and the 2.4 GHz Bluetooth stack. Here is a video demo from my previous project.

For this project, I am going to use the dynamic multi-protocol manager (DMM) to set each sensor node’s TI LPSTK-CC1352R1 node ID, and location.

LPSTK-CC1352R1 Sensor Data

From each TI LPSTK-CC1352R1 sensor node, I am going to send these data below to the TI CC1352R1 Launchpad collector.

  • Node ID.
  • Location.
  • Temperature.
  • Humidity.
  • Light.
  • Battery.

Each TI LPSTK- CC1352R1 sensor node’s Node ID and Location have been set to these below using Bluetooth connection.

  • Sensor node 1 – Node ID = 1, Location = PROD1.
  • Sensor node 2 – Node ID = 2, Location = PROD2.
  • Sensor node 3 – Node ID = 3, Location = PROD3.

PROD1, PROD2, and PROD3 refer to the production area in a manufacturing plant.

In a manufacturing plant, monitoring temperature and humidity is beneficial to make sure it is in the acceptable limits for manufacturing, equipment and people working in it. The temperature and humidity can be adjusted to meet acceptable limits.

Light lux intensity monitoring can be used to adjust appropriate brightness in a manufacturing plant, which will save on electricity usage costs.

The program running on the TI CC1352R1 Launchpad collector and TI LPSTK-CC1352R1 is based on my project AWS IOT Vaccine Carrier Cold Box collector and sensor programs. The collector and sensor program has been slightly modified to also output humidity and light sensor values.

To understand how the collector and sensor work, see these training materials from Texas Instruments.

Getting Started with Blues Wireless Notecard

To get started with your Notecard, go through the Blues Wireless Notecard Quickstart Guide. Connect your Notecard and Notecarrier to your computer using a USB connection. You will be able to send commands using the online command line interface. See, connecting your Notecard to a WiFi access point.

Access Point Hardware Connection

All three boards are powered from the TI CC1352R1 Launchpad USB 5V. Here are the connections below.

  • TI CC1352R1 Launchpad DIO12 UART RX <- Notecarrier A TX.
  • TI CC1352R1 Launchpad DIO13 UART TX -> Notecarrier A RX.
  • TI CC1352R1 Launchpad 3V3 -> Notecarrier A V+.
  • TI CC1352R1 Launchpad GND <-> Notecarrier A GND.

The TI CC1352R1 Launchpad UART communication is set to a 9600 baud rate.

Notecard JSON communication.

See these Blues Wireless topics below regarding JSON communication.

I made a test program using the TI CC1352R1 Launchpad to send JSON messages to Notecard WiFi and Notecarrier A.

I send this JSON message at initialization:

{“req”:”hub.set”, “product”: “your_product_uid”,”mode”:”continuous”}

I send this JSON message at left button press:

{“req”:”note.add”,”file”:”sensors.qo”,”sync”:true,”body”:{“temp”:20,”humid”:33,”light”:80,”batt”:3300,”rssi”:89}}

What is important is that there should be a newline (\n) at the end of every JSON message.

The C array containing the JSON message sent at initialization has been declared as below.

char initnote[100] = “{\”req\”:\”hub.set\”, \”product\”: \”your_product_uid\”,\”mode\”:\”continuous\”}\n”;

Here is the output at TeraTerm:

Here is the received JSON message at Notehub.

Modifying the Collector Example Program

The collector and sensor program are based on the repositories below. Which are for my project, AWS IOT Vaccine Carrier Cold Box.

I will not discuss in detail how to enable sending of humidity and light sensor data from the sensor node to the collector. Basically, you need to understand how both collector and sensor programs work in detail. It is complicated, but it just takes time to understand.

The collector uses a Common User Interface (CUI). The CUI is a display driver that outputs to the UART port at a 115200 baud rate. The same UART port is needed to communicate with Notecard WiFi and Notecarrier A. Although the TI CC1352R1 allows you to have to enable 2 UART ports, I need to use the default UART port to output to USB. Doing so enables me to see the output using TeraTerm. Here is the output at TeraTerm using the collector program CUI.

To disable the CUI, set the symbol CUI_DISABLE at collector.opts.

With the CUI disabled, the default UART port is free to communicate with Notecard WiFi and Notecarrier A.

I created uart_app.c and uart_app.h code files. They will contain code that will initialize the UART and write to the UART.

I call UartApp_Init() at main.c main().

The JSON string to initialize the Notecard WiFi is below.

// JSON message to initialize notecard added by markel
char initnote[100] = “{\”req\”:\”hub.set\”, \”product\”: \”your_product_uid\”,\”mode\”:\”continuous\”}\n”;

I send the JSON message to initialize the Notecard WiFi at collector.c Collector_init().

The received messages from sensor nodes are processed at csf.c Csf_deviceSensorDataUpdate(). The messages can be accessed at pMsg.

Blues Wireless provides libraries that you can use with Arduino boards, ESP32, STM32, and others. Since I use a Texas Instruments board, I reviewed the example program for TI MSP430, which uses the note c library. Upon review it is not readily usable to work with TI CC1352R1 programs running on TI-RTOS.

I used snprintf() to create the JSON message that I will send to Notecard WiFi. Here is the code at csf.c Csf_deviceSensorDataUpdate().

Video Demo

From Notehub you can route data to cloud service provider of your choice. See, guide below.

Intended Application

The TI CC1352R1 Launchpad collector board will be connected to Notecard WiFi and Notecarrier A. These three hardware will function as an access point to the internet using WiFi connectivity. The Notecard WiFi and Notecarrier A will communicate to a WiFi router and then to the internet. Ideally the access point hardware needs to be constantly powered for continuous communication with the internet. Therefore, the essential requirements for the access point hardware to work is WiFi connectivity and constant power. With these in mind the intended applications are those which has access to these essential requirements. Although for this project, I am only sending temperature, humidity and light sensor data to the collector, the sensor node can be modified for any intended applications. Here are the intended applications below.

  • Industrial applications.
  • Manufacturing plant monitoring.
  • Logistics warehouse monitoring.
  • Agriculture monitoring system.
  • Home monitoring.

Remote Monitoring

In most remote monitoring systems, an internet access point does not have access to a WiFi router and constant power. In that case, cellular and satellite communication is the recommended way to send data to the internet. Here below are Blues Wireless cellular and satellite notecards.

Buy Me a Coffee at ko-fi.com

Blues Wireless Notecard WiFi Python Test

Blues Wireless Notecard Wifi and Notecarrier A

I received a Blues Wireless Notecard WiFi v1, Notecard Cellular, and Notecarrier AA, when I joined the Hackster.io Build2Gether 2.0 contest.

My project contest entries to the contest did not involve the use of Blues Wireless hardware. So, after the contest, I have more time to learn about Blues Wireless hardware.

I have watched Blues Wireless customers videos saying how easy it is to integrate Blues Wireless into their product. Blues Wireless website documentation and guides are very helpful to get you started. In just a few minutes, you are already sending data from your Notecard to the internet. Other wireless hardware can take up to a few days until you are able to send data to the internet.

To get up and running with the Blues Wireless notecard, I went through the quickstart guide. Indeed, in just a few minutes, I was able to send data to the internet.

Notecard sends and receives data to Blues Wireless Notehub. Then the notehub routes the data to a cloud service provider of your choice.

For this blog, I will show how to use Python to communicate with the Notecard WiFi and send dummy sensor data to the Notehub. For dummy sensor data, I am going to send temperature, humidity, light, battery, and RSSI.

I am going to run Python using VS Code. Follow this video guide to set up Python at VS Code.

To install notecard python support at VS Code, execute python command pip install note-python at VS Code terminal.

Execute pip install pyserial command to install support for serial communication

Here is the python code.

What it does is send two JSON strings. The first one is below which is to set the Notecard in continuous mode.

{“req”:”hub.set”, “mode”:”continuous”}

The second one is to send the send the dummy sensor data to Notehub.

{“req”:”note.add”, “file”: “sensor.qo”, “start”: true, “body”:{“temp”:30,”hum”:60,”light”:80,”batt”:3300,”rssi”:80}}

Here is the terminal output after pressing the run button.

Here is the output at Notehub.

Next steps: I am planning to connect a wireless sensor network to the Notecard and send sensor data from several sensor nodes to the Notehub.

Buy Me a Coffee at ko-fi.com

Maduino Zero 4G GPS Tracker

For a 4G GPS tracker project I choose Makerfabs Maduino Zero 4G LTE(SIM7600X) Board. Because it has all the features needed to evaluate SIMCom 7600X.

pic from makerfabs website https://www.simcom.com/product/SIM7600X-H.html
pic from makerfabs website https://www.simcom.com/product/SIM7600X-H.html

Hardware Requirements:

Note: For Philippines select SIM7600E-H or SIM7600G-H.

Software Requirements:

  • Blynk with plus plan to include map widget.

From my initial testing and evaluation of Makerfabs Maduino Zero 4G LTE board the micro sim card socket broke because I use a miro sim to nano sim card converter to connect my nano sim card. Because of that I wired a nano sim card board to the Makerfabs Maduino Zero 4G LTE board.

AT_command_demo:

To get familiar with AT commands for SIMCom 7600X, I recommend to try the AT_command_demo.ino example program which can be found in the Maduino-Zero-4G-LTE Github Repository. You can use the Arduino IDE Serial Monitor to input commands.

Maduino Zero 4G GPS Code:

This code is originally made by techiesm, so credits to the creators. However the conversion of GPS NMEA to decimal does not work for the Philippines. I fixed it to work in the Philippines, but the code can be improved further. This has been tested using Arduino IDE 2.0. Make sure you have board support for Arduino Zero.

/*
 * 
 * This is the code for the Project 
 * 
 * 4G GPS Tracker using All new Blynk 2.0
 * It's full tutorial is uploaded on our YouTube channel
 * https://www.youtube.com/techiesms
 * 
 * 
 * Code written by Dhruv Soni for techiesms on 02/07/22
 * 
 * 
 * 
 */

 /* This GPS tracker Arduino code used Marduino Zero 4G LTE(SIM7600X) Board from Makerfabs
  * GPS Data is read and GSM is used to send GPS data to Blynk
  * This uses Blynk restful HTTP API to send GPS data to Blynk
  * https://docs.blynk.io/en/blynk.cloud/https-api-overview
  * The problem with this is that Blynk device appears offline. The best way is to use Blynk API
  * using TinyGSM library. https://github.com/vshymanskyy/TinyGSM 
  * Example code from link below.
  * https://community.blynk.cc/t/map-widget-wrong-location/57692
 */


#include <stdio.h>
#include <string.h>

#define DEBUG true
#define MODE_1A

#define DTR_PIN 9
#define RI_PIN 8

#define LTE_PWRKEY_PIN 5
#define LTE_RESET_PIN 6
#define LTE_FLIGHT_PIN 7

// Get your token or auth from your Blynk Device and copy here.
String token = "add your blynk device auth token here";
String loc = "";
String longitude = "";
String lattitude = ""; 

//FUNCTION TO PASS AT COMMAND

String sendData(String command, const int timeout, boolean debug)
{
  String response = "";
  Serial1.println(command);
  
  long int time = millis();
  while ( (time + timeout) > millis())
  {
    while (Serial1.available())
    {
      char c = Serial1.read();
      response += c;
    }
  }
  if (debug)
  {
    SerialUSB.print(response);
  }
  return response;
}

//FUNCTION TO CHECK SIGNAL STRENGTH

int check_signal(void)
{
  while(1)
  {
    String sig = sendData("AT+CSQ",3000,DEBUG);
    int i=0;
    String strength;
    while(sig[i]!=':')i++;

    String loc_2 = sig.substring(i+2);

    i=0;
    while(loc_2[i]!=',')i++;

    strength = loc_2.substring(0,i);

    int strength_1 = strength.toInt();
    SerialUSB.println(strength_1);

    return strength_1;
  }
}

//FUNCTION TO GET LATITUDE AND LONGITUDE STRING

void gpsLocation(String local)
{
//  char* loc_2 = local;
//  int p=0;
  
  while(1)
  {
    int i=0;
    while(local[i]!=':')i++;

    String loc_2 = local.substring(i+2);

    i=0;
    while(loc_2[i]!=',')i++;

    lattitude = loc_2.substring(0,i);
    SerialUSB.println(lattitude);

    int j = i+3;
    int k = j;

    while(loc_2[k]!=',')k++;

    longitude = loc_2.substring(j,k);
    SerialUSB.println(longitude); 

    return;
    
  }
}

//CONVERSION OF LATITUDE and LONGITUDE FROM NMEA to Decimal Degress
//This C function needs major improvement or replacement
//Return from AT+GPSINFO
//+CGPSINFO: 1424.515048,N,12057.739827,E,230123,074644.0,15.6,0.0,151.4
//Useful website to convert GPS NMEA to D.d decimal degrees.
//http://www.hiddenvision.co.uk/ez/?nmea_lat=1424.513029%2CN&nmea_lon=12057.735682%2CE
//Code references for converting GPS NMEA to D.d decimal degrees.
//https://stackoverflow.com/questions/36254363/how-to-convert-latitude-and-longitude-of-nmea-format-data-to-decimal

String conversion(String local, int i)
{
  String str_end;
  String str_init;
  if(local[0]=='0'){
      SerialUSB.print("local = 0\r\n");
      str_end = local.substring(3);
      str_init = local.substring(1,3);
      int val = str_init.toInt();
      double deci_val = str_end.toDouble();
      double new_value = val+(deci_val / 60);
      
      if(i == 1)
      {
        new_value = new_value * 10;
      }     

      String final_val = String(new_value,5);

      return final_val;
   }
  else if(local[0]!='0')
  {
      SerialUSB.print("local != 0\r\n");
      if(i == 0)
      {
        str_end = local.substring(2);
        str_init = local.substring(0,2);
      } 
      else if(i == 1)
      {
        str_end = local.substring(3);
        str_init = local.substring(0,3);
      }

      int val = str_init.toInt();
      double deci_val = str_end.toDouble(); 
      double new_value = val+(deci_val / 60); 
      String final_val = String(new_value,5);

      return final_val;
  }
}

//FUNCTION TO PASS LOCATION IN BLYNK API

void map_loc(String lat1,String lon1)
{
    String lat = conversion(lat1, 0);
    String lon = conversion(lon1, 1);

    SerialUSB.print("lattitude = ");SerialUSB.println(lat);
    SerialUSB.print("longitude = ");SerialUSB.println(lon);

    // Important to set the correct blynk server for Philippines is sgp1
    // You can find the blynk server at lower right of blynk webpage
    String http_str = "AT+HTTPPARA=\"URL\",\"https://sgp1.blynk.cloud/external/api/batch/update?token=" + token + "&V9=" + lon + "&V9=" + lat + "\"\r\n";    
    
    SerialUSB.println(http_str);
    sendData("AT+HTTPINIT\r\n", 3000, DEBUG);
    sendData(http_str, 3000, DEBUG);
    sendData("AT+HTTPACTION=0\r\n", 3000, DEBUG);
    sendData("AT+HTTPTERM\r\n", 3000, DEBUG);
}

void setup(){
  SerialUSB.begin(115200);
  //while (!SerialUSB)
//  {
    ; // wait for Arduino serial Monitor port to connect
//  }

  delay(100);

  Serial1.begin(115200);

  //INITIALIZING GSM MODULE
  pinMode(LTE_RESET_PIN, OUTPUT);
  digitalWrite(LTE_RESET_PIN, LOW);
  pinMode(LTE_PWRKEY_PIN, OUTPUT);
  digitalWrite(LTE_RESET_PIN, LOW);
  delay(100);
  digitalWrite(LTE_PWRKEY_PIN, HIGH);
  delay(2000);
  digitalWrite(LTE_PWRKEY_PIN, LOW);

  pinMode(LTE_FLIGHT_PIN, OUTPUT);
  digitalWrite(LTE_FLIGHT_PIN, LOW); //Normal Mode
  // digitalWrite(LTE_FLIGHT_PIN, HIGH);//Flight Mode

  SerialUSB.println("Maduino Zero 4G Test Start!");  

  SerialUSB.println(sendData("AT+CGMM\r\n", 3000, DEBUG));
  sendData("AT+CPIN?\r\n",3000,DEBUG);  
  sendData("AT+COPS?\r\n",3000,DEBUG);
  sendData("AT+CNUM\r\n",3000,DEBUG);

  //INITIALIZING GPS MODULE  
  sendData("AT+CGPS=0",3000,DEBUG);
  sendData("AT+CGPS=1",3000,DEBUG);
  delay(60000);
}

void loop(){
    //CHECKING SIGNAL STRENGTH
    if(check_signal()>=10)
    {
      loc = sendData("AT+CGPSINFO\r\n",3000,DEBUG);
      gpsLocation(loc);
      if(lattitude!=""&& longitude!="")
      {
        map_loc(lattitude,longitude);
      }
      delay(5000);  
    }      
}

Blynk Setup:

Create a new template and add map widget.

Create a Datastream with Data Type set to GPS and alias and name set to “V9”.

Select magnifying glass and create a new device from template.

Set device name.

Go to device info of your new device. Copy auth token to the arduino code.

Maduino Zero 4G GPS Tracker Demo:

Buy Me a Coffee at ko-fi.com

I think, I learn, I create

Design a site like this with WordPress.com
Get started