Almost recreated tutorial on Raspberry Pi

I have almost all the pieces to create the slider example.

  • I’m using the raspberryPi hardware interface suggested by @Carsten. My config.json is as follows (which doesn’t seem correct, but it works):
[
                {
                        "id": "testRaspberryaV6exmwwb8d6",
                        "ioName": "led1",
                        "pin": 16,
                        "direction": "out",
                        "edge": "none"
                },
                {
                        "id": "testRaspberryaV6exmwwb8d6",
                        "ioName": "button1",
                        "pin": 18,
                        "direction": "in",
                        "edge": "both"
                }
]
  • I have a testRaspberry HybridObject. I have created a target and can see my index.html with a slider using the Reality Editor.
  • I can turn the LED wired to the Raspberry Pi on and off using the slider in Reality Editor (very cool, by the way) by obj.write("led1",1) via slider input within index.html.
  • The IO Points are available within the Reality Editor, and I can create a link between button1 to led1.

But this where I’m lost. The object.json within the testRaspberry directory gets updated with the IO points, and even the links. When I push the physical button on the Raspberry, I’d expect the LED to turn on and off. I can see that the raspberryPI hardware interface is calling writeGpioToServer with the correct button1 value, which in turn is calling server.writeIOToServer. Maybe I’m missing a piece.

Possibly the piece I’m missing is that the button1 IO point is actually getting triggered, but index.html needs to read it and then pass the value to led1? But then how does breaking the link in Reality Editor remove the physical button functionality? In any case, within index.html, I’ve used obj.addReadListener("led1", ...) and can get the value of the LED (0 or 1 in the Raspberry Pi’s case). But I don’t get any value when listening to button1.

Hopefully these aren’t too specific questions. It seems that the trail of posts and documentation that is available keeps getting out of date quick, so it’s difficult to know what is current and what no longer works. If I can get this last piece working, I’d like to publish a complete learnings for other to use.

Thanks in advance. I’m really digging the project so far.

Hi @Quantumpee,
we are about to update the system and are a bit slow on the forum.
Stay tuned for news :slight_smile:

Some things will get more easier.

Could you tell me how you did it ? Could you share your code.

i also use raspberry pi,but i don’t know how to code the hardware interface