-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to connect Modbus device to Edgex Foundry? #178
Comments
@tonyespy @anonymouse64 it's question about using snap. could you please help answer him? thanks. |
@tonyespy @anonymouse64 Please help me with EgdeX. |
@cloudxxx8 In case I use Docker and Docker-compose to connect real modbus device (Inverter) to EdgeX Foundry? Can you give me a document or link about this stuff, please? I use Rasperry Pi 3 and I installed Ubuntu 18.04.5 server on SD card. |
Here is a tutorial |
@cloudxxx8 I updated device profile but at Device Service not show edgex-device-modbus. what's wrong? |
I am not sure whether it is an UI issue. Could you please try to call the REST API to see your Device Service? https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-metadata/1.2.0#/default/get_v1_deviceservice |
@cloudxxx8 I check device service then I know Modbus device service is Enable. But how can I check device connection in metadata and registered device in core data? Please help me ! |
Ah,I check device through curl -s http://Rasperry-IP:48081/api/v1/device | jq then I know device modbus is not exist. So, maybe device is not registered in metadata. How can I check this? |
@cloudxxx8 I can use this comment???? |
@trantram310 yes, please use POST API to create the Device. You have to create Device Profile first. |
@cloudxxx8 Ah, I updated Modbus Device profile successfully, but when I use POST API to create device that it's error ( error: invalid character 'A' looking for beginning of object key string) |
Configuration is for the service itself, and you should follow the JSON schema defined in the API to create the device The Modbus example shows in the "Set Up After Starting Services" section step 3. |
@cloudxxx8 I read document you give and I use POST API with statement. But it not create Modbus device for me. I check device profile in metadata then metadata has device profile. |
@cloudxxx8 My code and error |
it is a JSON format issue. please remove the comma in the last line of each {} block and "profile":{"name":"Test-Device-Modbus"}, |
@cloudxxx8 Maybe I miss DeviceID. So I fix 2 errors as you. It show Device ID and Name are both blank |
are you calling PUT or POST? You don't need to assign Id for POST |
@cloudxxx8 I call POST api. |
you have an additional space in the profile section |
@cloudxxx8 So, How can I check this error? Maybe in my device profile I put to metadata? |
@cloudxxx8 I check addressable then: |
No, the addressable is for Device Service, not Device. The error message Device ID and Name are both blank is incorrect. It should say: Device Profile ID and Name are both blank The problem is caused by your profile section in your Device creation: "profile":{"name ": "Test-Device-Modbus"} There is an additional space in "name ", so it says there is no name. |
@cloudxxx8 Yes, It returns me a ID. How can I get value from my Modbus device sensor. I use curl 192.168.1.22:48082/api/v1/device/{deviceId}/Lux , but it returns me 404 page not found |
if you use device id, you should also use command id. |
@cloudxxx8 I check device through curl 192.168.1.22:48081/api/v1/device | jq the know |
please paste the full result of 192.168.1.22:48082/api/v1/device in text |
Modbus..txt |
there are some URL fields in the result, and you should use them It is the API I mentioned |
@cloudxxx8 wait! I check 192.168.1.22:48082/api/v1/device and see it not show commands which I code in Modbus device profile. Is it real problems? This is all of about Modbus device when I check 192.168.1.22:48082/api/v1/device again. |
@cloudxxx8 When I use curl 192.168.1.22:48082/api/v1/device/6a29dc9b-c307-4f95-9b5e-4fed431ff6c9/Lux then it return me 404 page not found. it not have a lux value |
again, you hit thewrong API. Please see the API document. The API is not api/v1/device/{device id}/{command name} I also notice that the command sections are wrong in your profile. Please see the However, your profile contains |
@cloudxxx8 Yes, I do as you said about modbus device profile, I fix it and when I call curl 192.168.1.22:48082/api/v1/device then it return me commands. But when I call statements as command then it dont return me sensor data as I defined in device profile. It return me: |
@cloudxxx8 I check this commands and return me this errors. |
it's a permission issue. you should:
|
@cloudxxx8 I'm deploying through Snap store, not docker-compose file. So, I can't know the second you said. |
@cloudxxx8 I fix and check again. It returns errors: |
You have connected to the Device with the wrong starting address. For example from the document:
|
@cloudxxx8 I fix as you said. But it return me old error. This is my device document and deviceResources I defined. I dont know where is problem I meet ? |
@cloudxxx8 This is my full Device profile. Please help me find problem, I really need your help. |
The starting address is 1 base, so you can try |
@cloudxxx8 It returns me old errors. But i dont know when I call this command then it return is that Device not found while I created it?? |
@cloudxxx8 When I check port UART I use to read sensor data then I see. |
@cloudxxx8 I dont know here is my problem. I check file configuration.toml in /snap/edgex-device-modbus/1256/config/device-modbus/res then I see it not define [Devicelist]. Here is all in file configuration.toml in edgex-device-modbus packet I install through Snap |
please restart the modbus device service and try again |
A couple of comments...
|
|
please check the log of device-modbus container |
Hi, I'm newbie in Edgex Foundry. I want to connect Modbus device( inverter Delta-vfd-l) to Device Service. I install Edgex Foundry on rasperry Pi 3 through sudo snap install edgexfoundry and Edgex UI showed at http://((your-raspberry-pir-url):4000/. I read lots of documents but all guide use Docker to deploy Edgex. How to connect Modbus device to Device Service not use Docker? Please help me
The text was updated successfully, but these errors were encountered: