Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: Using Xbee Cellular Modem with ThingSpeak

Home Forums Mayfly Data Logger Using Xbee Cellular Modem with ThingSpeak Reply To: Using Xbee Cellular Modem with ThingSpeak


    Hi @zeke-holloman – looks like the ThingSpeak keys and channel need to be added.

    Add them to (the following are examples)
    const char* thingSpeakMQTTKey =
    “Z0G6QX4IXEHKG0PK”; // Your MQTT API Key from Account > MyProfile.
    const char* thingSpeakChannelID =
    “5940”; // The numeric channel id for your channel eg
    const char* thingSpeakChannelKey =
    “DHCKWX0HZQLXGIAX”; // The Write API Key for your channel

    Your response is
    Topic [ 41 ]: channels/thingSpeakChannelID/publish/thingSpeakChannelKey

    and it should look something like

    Topic [ 38 ]: channels/5940/publish/DHCKWX0HZQLXGIAX <–ThingSpeakPublisher

    Followed by this
    Dumping the TX Buffer <–dataPublisherBase
    Message [ 129 ]: created_at=2021-07-28T19:04:00-08:00&field1=1&field2=2000.000&field3=-0.223&field4=4.1748&field5=4.215&field6=22.20&field7=0.0088 <–ThingSpeakPublisher
    Opening MQTT Connection <–ThingSpeakPublisher
    MQTT connected after 874 ms <–ThingSpeakPublisher
    ThingSpeak topic published! Current state: 0: MQTT_CONNECTED
    Disconnecting from MQTT <–ThingSpeakPublisher
    Disconnected after 418 ms <–ThingSpeakPublisher