19 October, 2023

Suntech device data via API

How to obtain telematics data from any Suntech device via API.

You can obtain telematics data from any Suntech device in 6 easy steps:

  1. Create a free account on flespi.io.

  2. Set up the Suntech channel in your flespi.io interface.

  3. Point a Suntech device to your flespi account using the device configurator from Suntech or by sending an SMS command to the device.

  4. Confirm that the device data is being received and parsed.

  5. Access Suntech device data via API.

  6. Create a flespi device to access telemetry, apply plugins and analytics, and use long-term message storage.

1. Create a free flespi account

Go to www.flespi.io and click on 'LOGIN / REGISTER':

flespi

You can choose from a number of third-party service accounts to log in under or the right-most option @ to register with your name and email address. 

flespi platform


2. Set up the Suntech channel on flespi.io

Click on Telematics Hub, then on Channels, then on the '+' button in the lower right corner of the screen.

flespi channels

The Channel dialogue box will show up. Enter the name for the channel (any text will suffice), select “suntech” in the protocol_id drop-down menu, click 'SAVE + OPEN'.

You're forwarded to the "Channel" details box. Make a note of the domain name and port that you should point your device to. IMPORTANT: The image below indicates where to find the info and is NOT an actual domain/port for you to use (in flespi each channel created by you has its own IP and port).

3. Point your Suntech device to your flespi channel

You can do it with Suntech’s SyncTrak configurator tool (available by request from Suntech tech support) or by sending an SMS command to the device.  Detailed instructions can be found on the Suntech Support website.

Suntech tech contacts vary based on the region where the customer is located:


4. Confirm that the device data is being received and parsed

While in the Channel dialogue box, click on the Logs & Messages tab. Inspect log records to confirm that your device has successfully connected to flespi. The presence of messages in the lower half of the screen will confirm that the incoming data is parsed. Please keep in mind that in as Logs section runs in realtime it will reflect any connection attempt. Hint: you can right-click on a message or log to show corresponding raw traffic.

In case of any issues, check our troubleshooting checklist.


5. Access Suntech device data via API

Make a note of what your Channel ID is:

Click on API Playground menu item in the lower left corner:

In the menu on the left under Gateway API click on channels. Scroll down until you see GET /channels/{1-ch-selector}/messages request. Click on it to reveal additional fields.

flespi rest api channel

Fill in your channel ID in the 1-ch-selector field. Scroll a little lower until you see 'eye' button and click on it.

flespi  queclink api

And here you have it - device messages in an easy-to-read JSON format.

{
"result": [
{
"backup.battery.voltage": 4.1,
"channel.id": 11128,
"device.id": 1735432,
"device.model": "st940",
"device.name": "Penguin",
"device.type.id": 414,
"din": 0,
"din.1": false,
"din.2": false,
"din.3": false,
"dout": 0,
"dout.1": false,
"dout.2": false,
"engine.ignition.status": true,
"engine.motorhours": 297.916667,
"event.code": "ALT",
"event.enum": 10,
"external.powersource.voltage": 12.61,
"gnss.vehicle.mileage": 3519.185,
"gsm.cellid": 0,
"gsm.lac": 0,
"gsm.mcc": 0,
"gsm.mnc": 0,
"gsm.signal.dbm": -110,
"ident": "107764423",
"message.buffered.status": true,
"peer": "201.166.177.179:22567",
"position.direction": 0,
"position.latitude": 19.372353,
"position.longitude": -98.979707,
"position.satellites": 3,
"position.speed": 0.163,
"position.valid": true,
"protocol.id": 125,
"server.timestamp": 1702668559.292488,
"software.version": "581",
"timestamp": 1702668516
}
]
}

6. Create a flespi device

This step takes interaction with your device on a qualitatively new level — get access to device telemetry, easily send configuration commands, configure post-processing using plugins, aggregate messages into intervals, benefit from extended message storage.

Click on Telematics Hub, then on Devices, then '+' button in the lower right corner. You need to choose the proper device type ID and specify the device configuration. Hit Save when you're ready.

Now you can use the device API to access device data, send commands, and a lot more, or explore the numerous tabs on the device card. 

Got questions? We're just one click away to assist you in the chat. :)


What's next?