Losant Edge-Agent Pi gpio

HI,
This may have been answered before, appologies if so but I cannot find it.

If I have the Edge Agent installed on a Raspberry Pi can I access the gpio with it? Eg. can I program in the edge workflow to utilise the gpio?
From what I can acertain at the moment I would have set up the Pi as a seperate device (running code) alongside the edge agent.

Programming remotely to utilise the gpio with your workflows UI would be a really sweet feature it not already there! Would save SSH, VNC ect. and it’s just nicer to use.

Thanks in advance.

Hello,

To answer your question, Losant currently does not have a Raspberry PI GPIO Node that you can use in your edge workflow to directly access the GPIO.

I agree that you would be able to use the Losant Edge Agent to control your Raspberry Pi GPIO by having additional code running on the Raspberry Pi (or create another Docker image that has the code in it). If you create another Docker image with your code in it, then when deploying to other Raspberry Pis you would pull down and run this Docker image that you created and the Losant Edge Agent.

If you go the route of another Docker container, you will have to allow this Docker container to have access to the GPIO. Here is an article that shows how this can be done.

Within this Docker container that you create, you can run a webserver that accepts HTTP requests from the Losant Edge Agent which will then read or command the GPIO. It will act as the interface between the GPIO and the Losant Edge Agent.

In addition to this solution, there is a blog post on how to control the Raspberry Pi GPIO with Losant (but it does not use the Losant Edge Agent).

Let us know if you have any other questions and how you end up building this solution to allow the Losant Edge Agent to control your Raspberry Pi GPIO.

Thank you,
Kevin

Kevin,

I was just hoping for a simple solution. I was looking for an easy way of Monitoring the state of switches and maybe control where the pi is already and as I have the edge agent installed I thought that would be cracking, as I say easy programming. I do not so much need the agent to access it it’s more getting that info to the platform, not really time critical.

I will look at both, thankyou. Although I do often find I loose an aweful lot of time when it comes to docker and access ect. I’ve already given up on trying to get the Modbus Serial Com working instead routing it over TCP to Mbusd running on the same device. I have had this before with other software as well.

Thanks again.

Hello,

I totally get where you are coming from and agree it would be very nice to be able to do what you suggest. I will think over this solution more and do some research and let you know what I come up with. Please share any insights you get while setting this solution up.

In regards to Modbus Serial connection [and if you would like to try Modbus Serial again], try following the post below to get access to your serial connections.

Best of luck and thank you,
Kevin