UniPi API - need to use Win 10 IoT or Mono

Hi,
I looking for some API for UniPi for create library that help me use UniPi with Windows 10 IoT or Mono Develop.
How UniPi communicates with raspberry?
Is it some I2C or what?
Which PINS are used for what?

I think it is possible to make some reverse engineering but it is a little waste of time today…

Hi,
I looking for some API for UniPi for create library that help me use UniPi with Windows 10 IoT or Mono Develop.
How UniPi communicates with raspberry?
Is it some I2C or what?
Which PINS are used for what?

I think it is possible to make some reverse engineering but it is a little waste of time today…

Regarding the development, we provide API written in Python that supports REST and websocket communication and modbus in a few weeks - https://github.com/UniPiTechnology/evok , we have no experience with Win10 neither Mono.

I think it could be possible to use EVOK on web based systems, but problem is with embeded solutions.
It means there is no Raspbian but only for ex. Win 10 IoT with static start application which will communicate directly to unipi throught GPIOs.

Do you have any UniPi I2C API description how to communicate with it?
Because I didn't find it in you docs so I assume that is your internal documentation, and the only way for check how it works is reverse engineering evok.

In other way it could be possible to use Evok, and Mono application loaded on afeter bootup raspbian.

raspbian can be stripped down to almost read-only system (see minibian or diet-pi projects) with installed EVOK and disabled web interface. Than users can build their own applications on top of evok (eg. using websocket locally) because there are many examples of using websocket clients in every SDK. You can also build nice embedded application using stripped down raspbian + evok and mono.

I2C has no API, it is just system of write-to-register and read-from-register commands and every chip on the I2C bus requires specific set of these commands but it is not difficult at all and can be found in docummentation of every chip we used - MCP23008, MCP3422, 1Wire DS2408 + GPIO library.

Hello,
I've downloaded the Windows 10 IOT core drivers using nuget, but the link to the related documentation is dead. Without code examples it is really difficult to start using the driver. Would it be possible to share a couple of examples on how to initiate the driver and read out device related information?
Kind regards,
Mario

Unfortunately we do not have local copies of the documentation, to the best of my knowledge. I understand that this is less-than-ideal, however if you still wish to use Windows 10 IoT I recommend extracting the .nupkg with 7zip and loading the library "adcoso.iot.devicedrivers.neuron.driver.dll" inside into ILSpy.

It works remarkably well for using undocumented C# libraries. Though we would still very much welcome if @mircotoepfer could provide us with some more documentation on how to use the library, which we would then perhaps be able to host ourselves.

arkably well for using undocumented C# libraries. Though we would still very much welcome if @mircotoepfer could provide us with some more documentation on how to use the library, which we would then perhaps be able to host ourselves.
Here is a quick sample of what the ILSpy analysis looks like:

I hope it will be of some help. If you do decide to make use of the existing driver you may also find the dnSpy utility helpful if you wish to make any changes, as it allows directly editing c# binaries, either in c# directly or in the interpreted instruction language underneath. It can also decompile directly into a Visual Studio project, but some manual editing is required afterwards to recompile.

Another useful tool might be the Patchwork Launcher's OpenAssemblyCreator utility, which allows overloading private parts of any c# binaries by making a copy which has all members declared as public - any binary compiled against such a modified copy will be able to link against a non-modified library as well, since c# member hiding is purely a link-time affair.

Hi,
After some digging around I've actually found the source code including example on github:https://github.com/mircotoepfer/unipi-neuron
I was actually very close to understanding how it should work. The example code included in the project on github is not working (the NeuronDevice object stays empty). I'm still trying to figure out what is happening, but it seems something goes wrong in the GPIO pin-layout.
When I use the Windows GPIO driver with this pinlayout, and match that to the GPIO pin-layout of the UniPI (according to the technical documentation) I see some inconsistencies as well. For example, GPIO 7 and 8 (should be digital inputs 8 and 9, pull down according to the piyout) are always high, while they are not connected. GPIO 4 (digital input 1) seems to be working (high when not connected, low while connected, pull down).

Update: the unipi Neuron driver is not suitable for UniPi 1.1. It assumes that all the ports are located on the SPI bus: the Neuron has a different architecture compared to the UniPi. I have the most important things working now (digital inputs, onewire, relays) but still need some work on the analogue inputs and outputs. I will start wrapping things up and will publish a project on github when it's ready. As I'm not a professional software developer it will not be as nice as Mirco's solution, but it should do the trick and provide similar functionality :-).

That's great to hear! We would love to have a look at it once you are happy to have it be public. And thank you for finding the link to the documentation as well, it should be very useful to us in the future.

Hi Thomas,
I've uploaded the driver here:https://github.com/marioverhaeg/UniPi
AnalogueInputs and outputs are not implemented, but digitalinputs, onewire and relays are working. There are some events and some functions to poll information from the board. As said, I'm far from a professional developer but it might help others to understand how to read information from the UniPi. I will try to update the project now and then when I make improvements.