none
Recommendation on opening Gate using RPi RRS feed

  • Question

  • Hi,

    Wonder if you can suggest a good solution to this.  We have a VB.NET WinForms app we need to add a button to open a gate after some logic.  I understand WinForms doesn't talk to Rpi.  Would you suggest us to build/deploy a REST WebApi to the RPi that controls GPIO and call an endpoint from this REST API from the WinForms?

    Would a REST API be too much and you'd recommend a different/more straight forward approach?

    Note: We're not planning on modernizing the WinForms for now.

    Thanks so much,

    Sergio

    Friday, November 22, 2019 4:43 PM

Answers

  • Hello Sergio,

    Yes, Web API is a solution for your requirement.  .Net Core 3.0 supports on RPi, and .NET Core can be used to build applications for IoT devices and scenarios. IoT applications typically interact with sensors, displays and input devices that require the use of GPIO pins, serial ports or similar hardware. Please see this document.

    There are some other ways to implement that. You can also create a socket listener and define a custom protocol, the WinForm app talks with the device via TCP communication.

    It is hard to say which way is easier for you.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Sergio_CL Saturday, January 11, 2020 3:29 AM
    Monday, November 25, 2019 6:41 AM
    Moderator

All replies

  • Dear friend,

    I wonder if this sample meets your requirement. In this project, we’ll create a simple Blinky app service and connect a LED (simply change LED to relay to control your door) to your Windows IoT Core device (Raspberry Pi 2 or 3, Up Squared or DragonBoard). We'll also create a simple app service client that blinks the LED (change the state of your door). And you can achieve this by a browser in the same network.

    Please refer to this: Using an app service to blink an LED


    Keep Fighting

    Monday, November 25, 2019 4:26 AM
  • Hello Sergio,

    Yes, Web API is a solution for your requirement.  .Net Core 3.0 supports on RPi, and .NET Core can be used to build applications for IoT devices and scenarios. IoT applications typically interact with sensors, displays and input devices that require the use of GPIO pins, serial ports or similar hardware. Please see this document.

    There are some other ways to implement that. You can also create a socket listener and define a custom protocol, the WinForm app talks with the device via TCP communication.

    It is hard to say which way is easier for you.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Sergio_CL Saturday, January 11, 2020 3:29 AM
    Monday, November 25, 2019 6:41 AM
    Moderator