Arduino Atmega1284 and Starnote for Skylo Starter Kit

I purchased a Starnote for Skylo Starter Kit to work with an atmega1284.

The atmega1284 has two UARTs:
Serial
Serial1

I have the Notecard and Starnote on the Notecarrier.
Connecting via USB via a browser works fine.

I tried programming a transmission with an atmega1284.

Connecting RX and TX between the boards
Connecting GND

But I get this error. And it doesn’t do anything.

15:53:40.272 → [ERROR] bad {io}
15:53:40.272 → [ERROR] bad {io}
15:53:41.034 → [WARN] bad {io}
15:53:41.526 → [INFO] {“req”:“note.add”,“sync”:true,“body”:{“temp”:0,“voltage”:0,“count”:5}}
15:53:42.614 → [ERROR] bad {io}
15:53:42.614 → [ERROR] bad {io}
15:53:43.375 → [WARN] bad {io}
15:53:43.871 → [INFO] {“req”:“note.add”,“sync”:true,“body”:{“temp”:0,“voltage”:0,“count”:5}}
15:53:44.959 → [ERROR] bad {io}

Do I have to have Notecarrier on both boards as USB, or do I have to remove the Notecard from the ESP?

I’ve tried connecting via i2c, but it doesn’t work. It doesn’t do anything.

Any ideas or help?

Thanks

Welcome @jtxu !

Could you please share the Arduino code you are using? You do need to have both the Notecard and Starnote connected to the Notecarrier, as the Starnote can only be used as a back up for a Notecard.

Your wiring sounds correct but a photo of how everything is connected would also be appreciated!

Thanks,
Alex

 
#include <Notecard.h>

 

#define txRxPinsSerial Serial1
#define usbSerial Serial

uint32_t i2cAddress = 0x24;
//0x17
//0x18

// This is the unique Product Identifier for your device.  This Product ID tells
// the Notecard what type of device has embedded the Notecard, and by extension
// which vendor or customer is in charge of "managing" it.  In order to set this
// value, you must first register with notehub.io and "claim" a unique product
// ID for your device.  It could be something as simple as as your email address
// in reverse, such as "com.gmail.smith.lisa:test-device" or
// "com.outlook.gates.bill.demo"

// This is the unique Product Identifier for your device
#ifndef PRODUCT_UID
#define PRODUCT_UID "xxx"
#pragma message "PRODUCT_UID is not defined in this example. Please ensure your Notecard has a product identifier set before running this example or define it in code here. More details at https://dev.blues.io/tools-and-sdks/samples/product-uid"
#endif

#define myProductID PRODUCT_UID
Notecard notecard;

// One-time Arduino initialization
void setup()
{

  delay(5000);
    // Set up for debug output (if available).
#ifdef usbSerial
    // If you open Arduino's serial terminal window, you'll be able to watch
    // JSON objects being transferred to and from the Notecard for each request.
    usbSerial.begin(115200);
 
#endif
 
    notecard.setDebugOutputStream(usbSerial);
 

    // Initialize the physical I/O channel to the Notecard
#ifdef txRxPinsSerial
    notecard.begin(txRxPinsSerial, 9600);
#else
    notecard.begin(i2cAddress);
#endif

    // "newRequest()" uses the bundled "J" json package to allocate a "req",
    // which is a JSON object for the request to which we will then add Request
    // arguments.  The function allocates a "req" request structure using
    // malloc() and initializes its "req" field with the type of request.
    J *req = notecard.newRequest("hub.set");

    // This command (required) causes the data to be delivered to the Project
    // on notehub.io that has claimed this Product ID (see above).
    if (myProductID[0])
    {
        JAddStringToObject(req, "product", myProductID);
    }

    // This command determines how often the Notecard connects to the service.
    // If "continuous", the Notecard immediately establishes a session with the
    // service at notehub.io, and keeps it active continuously. Due to the power
    // requirements of a continuous connection, a battery powered device would
    // instead only sample its sensors occasionally, and would only upload to
    // the service on a "periodic" basis.
    JAddStringToObject(req, "mode", "continuous");

    // Issue the request, telling the Notecard how and how often to access the
    // service.
    // This results in a JSON message to Notecard formatted like:
    //     {
    //       "req"     : "service.set",
    //       "product" : myProductID,
    //       "mode"    : "continuous"
    //     }
    // Note that `notecard.sendRequestWithRetry()` always frees the request data
    // structure, and it returns "true" if success or "false" if there is any
    // failure. It is important to use `sendRequestWithRetry()` on the first
    // message from the MCU to the Notecard, because there will always be a
    // hardware race condition on cold boot and the Notecard must be ready to
    // receive and process the message.
    notecard.sendRequestWithRetry(req, 5); // 5 seconds
}

// In the Arduino main loop which is called repeatedly, add outbound data every
// 15 seconds
void loop()
{

    // Count the simulated measurements that we send to the cloud, and stop the
    // demo before long.
    static unsigned eventCounter = 0;
    if (++eventCounter > 25)
    {
        usbSerial.println("[APP] Demo cycle complete. Program stopped. Press RESET to restart.");
        delay(10000); // 10 seconds
        return;
    }

    // Rather than simulating a temperature reading, use a Notecard request to
    // read the temp from the Notecard's built-in temperature sensor. We use
    // `requestAndResponse()` to indicate that we would like to examine the
    // response of the transaction.  This method takes a JSON data structure,
    // "request" as input, then processes it and returns a JSON data structure,
    // "response", with the response. Note that because the Notecard library
    // uses malloc(), developers must always check for `NULL` to ensure that
    // there was enough memory available on the microcontroller to satisfy the
    // allocation request.
    double temperature = 0;
    J *rsp = notecard.requestAndResponse(notecard.newRequest("card.temp"));
    if (rsp != NULL)
    {
        temperature = JGetNumber(rsp, "value");
        notecard.deleteResponse(rsp);
    }

    // Do the same to retrieve the voltage that is detected by the Notecard on
    // its `V+` pin.
    double voltage = 0;
    rsp = notecard.requestAndResponse(notecard.newRequest("card.voltage"));
    if (rsp != NULL)
    {
        voltage = JGetNumber(rsp, "value");
        notecard.deleteResponse(rsp);
    }

    // Enqueue the measurement to the Notecard for transmission to the Notehub,
    // adding the "sync" flag for demonstration purposes to upload the data
    // instantaneously. If you are looking at this on notehub.io you will see
    // the data appearing 'live'.
    J *req = notecard.newRequest("note.add");
    if (req != NULL)
    {
        JAddBoolToObject(req, "sync", true);
        J *body = JAddObjectToObject(req, "body");
        if (body != NULL)
        {
            JAddNumberToObject(body, "temp", temperature);
            JAddNumberToObject(body, "voltage", voltage);
            JAddNumberToObject(body, "count", eventCounter);
        }
        notecard.sendRequest(req);
    }

    // Delay between samples
    delay(15 * 1000); // 15 seconds
}

I’ve connected raspberry serial to notecarrier xs
no luck

{“req”:“hub.set”,“mode”:“continuous”,“product”:“xxx”}
Response:
.set {not-supported}{io}"}

{“req”:“card.version”}
{“device”:“skylo:9019800xxx”,“name”:“Blues Inc Starnote”,“version”:“starnote-8.1.5.17241”,“sku”:“NTN-SKY1”,“ordering_code”:“ZZ”,“body”:{“org”:“Blues Inc”,“product”:“Starnote”,“version”:“starnote-8.1.5.17241”,“ver_major”:8,“ver_minor”:1,“ver_patch”:5,“ver_build”:17241,“built”:“Jun 6 2025 18:50:09”}}

Hi @jtxu

It looks like you are trying to connect directly to the Starnote from your Arduino. This is not how the Starnote is designed to be operated. Starnote works as a backup network transport for the Notecard and cannot be used standalone.

In order to use the Starnote for NTN transport, you must place BOTH the Notecard and the Starnote into the Notecarrier XS board. Then you should connect your Arduino to the Notecard (NOT the Starnote), either by I2C or UART.

When you use the {“req”:“card.version”} command, you should see the Notecard report it’s status.

You can then configure the Notecard to pair with the Starnote using this guide. You can check if the Starnote has been paired with the Notecard by following these instructions.

Thanks,
Alex

Using the browser with CLI commands, I was able to populate notehub.io with data without any problems.

I’ve updated the firmware and everything.

My question is if I can use notecarrier to populate notehub.io with data without using CLI commands.

I want to upload sensor data, etc., without using CLI commands.

Thank you

Hey @jtxu,

When you integrate a host MCU to communicate with Notecard + Starnote, your host must interface with Notecard using I2C or AUX UART, as Starnote connects to your Notecard via standard UART.

You should perform an I2C connection between you Arduino board and Notecard, and then in your firmware replace this bit:

    // Initialize the physical I/O channel to the Notecard
#ifdef txRxPinsSerial
    notecard.begin(txRxPinsSerial, 9600);
#else
    notecard.begin(i2cAddress);
#endif

With just this:

notecard.begin()

If you’re still having issues after making those changes, please send us a photo of how you have your hardware connected so we can see if the I2C connection is being made correctly.

Thanks,
TJ VanToll

1 Like