Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

IS there a client library for C#?
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

IS there a client library for C#?

by himoh82538 on Sat May 29, 2021 10:47 am

Basically, I want to do the following thing, that I do on a microcontroller, on a desktop C# Windows application (Ethernet).
Code: Select all | TOGGLE FULL SIZE
AdafruitIO_Feed *digital = io.feed("digital");
  io.connect();
  digital->onMessage(handleMessage);

Is there a library that does the same thing in C# on Windows? I have searched the NuGet, and the top result was AdafruitClassLibrary, but it just says that it is "Library for Adafruit hardware under Windows IoT Core", so I am not sure if this is what I am looking for. I am trying to receive feed events on a regular Windows PC.

himoh82538
 
Posts: 3
Joined: Fri May 28, 2021 11:45 pm

Re: IS there a client library for C#?

by x00syn4ps3 on Sat May 29, 2021 12:14 pm

Hey how's it going?

So, even though I'm not an active Adafruit contributor, I do use a ton of various microcontrollers on a regular basis for doing little side projects. I've been planning on putting together a desktop application at some point in the near future to pull Adafruit IO feed data and display it on the app, to save from having to always open up a browser and pull up IO that way. When I get around to it I can let you know, but in the mean time, I would highly recommend using something a lot more simple and direct to achieve your goals..i.e. NOT using C#.

Granted, I have only worked on a small number of C# programs. I have however had a blast at writing tons of python applications that communicate with Adafruit IO using their helper libraries. I have a GitHub repo that uses regular Python running on a Raspberry Pi to communicate with AIO to publish sensor readings from a Pimoroni Enviro Feather. They included it in the contrib section of their repo. I encourage you to check it out, as well as the Adafruit "Blinka" library, which my program uses. It's an abstraction layer that allows you to use regular Python to interact with sensors, as well as use the Adafruit IO helper libraries to send and retrieve values.

If you are only pulling feed data, you shouldn't even need Blinka, just pip install the adafruit-io package!!!

Check it out!

https://github.com/dedSyn4ps3/EnviroPlus-FeatherWing
https://pypi.org/project/adafruit-io/

x00syn4ps3
 
Posts: 7
Joined: Thu Sep 19, 2019 11:59 pm

Re: IS there a client library for C#?

by brubell on Tue Jun 01, 2021 10:00 am

Is there a library that does the same thing in C# on Windows?

We don't have a C# library. You'll want to find a library (likely Microsoft provides something native for C#) that can perform HTTP web requests. We have a fully documented HTTP API here: https://io.adafruit.com/api/docs

brubell
 
Posts: 1381
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.