Comments (7)
Hi @IhorYednak,
Thank you for your interest in Thingsboard IoT Gateway, in order to use your config you can try to send the following request:
endpoint - http://92.111.176.157:5000/my_devices
method - POST
data:
{
"sensorName": "Ihor's Test",
"sensorType": "default",
"sensorModel": "Value1",
"certificateNumber": "Value2"
}
Also you can modify the configuration like the following to process your request, but you still need to choose some endpoint to send, for example - "/my_endpoint" and send request to http://92.111.176.157:5000/my_endpoint , mapping configuration for this case will be the following:
...
{
"endpoint": "/my_endpoint",
"HTTPMethods": [
"POST"
],
"security": {
"type": "anonymous"
},
"converter": {
"type": "json",
"deviceNameExpression": "${name}",
"deviceTypeExpression": "default",
"attributes": [
{
"type": "string",
"key": "firstParameter",
"value": "${parameterOne}"
}
],
"timeseries": [
{
"type": "string",
"key": "secondParameter",
"value": "${parameterTwo}"
}
]
}
},
...
To get more information about REST and other connector you can use our official documentation.
from thingsboard-gateway.
Thank you for your response @imbeacon this is very useful, I corrected my config file, so now it looks like this:
`"host": "127.0.0.1",
"port": "5000",
"SSL": false,
"mapping": [
{
"endpoint": "/my_endpoint",
"HTTPMethods": [
"POST"
],
"security": {
"type": "anonymous"
},
"converter": {
"type": "json",
"deviceNameExpression": "${name}",
"deviceTypeExpression": "default",
"attributes": [
{
"type": "string",
"key": "firstParameter",
"value": "${parameterOne}"
}
],
"timeseries": [
{
"type": "string",
"key": "secondParameter",
"value": "${parameterTwo}"
}
]
}
},`
But still I got error in Postman and can't process the request
Maybe there's something to do with the URL ip address?
from thingsboard-gateway.
Could you check is port opened on your machine and expects connection?
sudo netstat -tlpn | grep 5000
from thingsboard-gateway.
@imbeacon
This is what I got
from thingsboard-gateway.
from thingsboard-gateway.
Ok, it looks like the request cannot arrive to the server, please try to run the following command from the server:
curl -X POST -H "Content-Type: application/json" -d '{
"sensorName": "Ihor'\''s Test",
"sensorType": "default",
"sensorModel": "Value1",
"certificateNumber": "Value2"
}' http://127.0.0.1:5000/my_devices
and from external machine:
curl -X POST -H "Content-Type: application/json" -d '{
"sensorName": "Ihor'\''s Test",
"sensorType": "default",
"sensorModel": "Value1",
"certificateNumber": "Value2"
}' http://92.111.176.157:5000/my_devices
If first arrives - the issue may be in firewall or network, for example with port forwarding.
from thingsboard-gateway.
Thank you @imbeacon, the issue is solved, I was able to get the data over it by typing the address of the VM itlsef in the rest.json file instead of 127.0.0.1 and after that post data from external machine.
so 5 IOT starts of 5 😄
from thingsboard-gateway.
Related Issues (20)
- [BUG] socket_connector.py is missing get_id definition HOT 1
- [BUG] Architecture issue with latest tb-gateway image (3.4.6) HOT 5
- [BUG] Error log -- Timeout while waiting for a publish to ThingsBoard! HOT 5
- [BUG] OPC-UA AsyncIO does not find sub variables HOT 2
- [BUG] Latest version (3.4.6) not correctly recognized (version 0.0 instead of 3.4.6) HOT 2
- [HELP] Unable to Maintain connectivity between IoT Gateway & Thingsboard CE server/Thingsboard Edge HOT 1
- [HELP] modbus TCP reads only first "timeseries"
- Modbus TCP |ERROR| - [tb_logger.py] - tb_logger - exception - 98 - Exception Response(131, 3, IllegalAddress)[HELP] HOT 2
- [BUG] 100% CPU usuage of thingsboard-gateway HOT 5
- When The gateway runs for a long time, RuntimeError: Message publish failed: The client is not currently connected.
- Potential [BUG] MQTT connector not honoring client attribute requests , only shared attribute requests
- [HELP] RuntimeError: Message publish failed: The client is not currently connected.
- [HELP] Can't get the latest telemtry data HOT 1
- Cannot load GRPC connector!Gateway Shell HOT 3
- How to connect my gateway to thingsboard Community Edition(Thingsboard CE) HOT 2
- ThingsBoard IoT Gateway not sending all the parameters configured in SNMP connector to ThingsBoard PE server - Help Wanted
- [HELP]: make Dynamic dashboard for 'Markers Placement' HOT 1
- [HELP] Ubuntu 24.04 LTS installation HOT 1
- [HELP] IoT Gateway as modbus slave to send TS data to PLC HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thingsboard-gateway.