Windows 10 IoT Core and UPS PICo

Support for the Uninterruptible Power Supply
with Peripherals and I2C control Interface
Raspberry Pi® B+, A+, B, and A
User avatar
Pimaster
Site Admin
Posts: 1615
Joined: Fri Sep 14, 2012 9:50 am

Re: Windows 10 IoT Core and UPS PICo

Post by Pimaster » Tue Sep 06, 2016 1:20 am

mischaboender wrote:Anybody made some progress on this? Trying to communicate to the Pico UPS over I2C, but I'm only getting "0xFF" back each time.
Hi,
I never tested it with Windows IoT.
BR PiM
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
piguy45
Posts: 5
Joined: Sat Nov 05, 2016 11:00 am

Re: Windows 10 IoT Core and UPS PICo

Post by piguy45 » Tue Nov 08, 2016 11:57 am

Anyone had any luck? I'm on the latest v3 ups version, the following code throws an error @ I2cDevice.FromIdAsync
{"The requested connect mode conflicts with an existing mode on one or more of the specified pins.\r\n\r\n\\\\?\\ACPI#MSFT8000#1#{a11ee3c6-8421-4202-a3e7-b91ff90188e4}\\I2C1': The I2C bus could not be opened due to a muxing conflict. Make sure the pins are not in use by another function."}


Any help would be greatly appreciated, thanks!

const string I2cControllerName = "I2C1";
const byte I2cUpsStatusAddress = 0x69;

var deviceSelector = I2cDevice.GetDeviceSelector(I2cControllerName);
var devices = await DeviceInformation.FindAllAsync(deviceSelector);

if (devices == null || devices.Count() == 0)
throw new Exception("No i2c devices found.");

var upsStatusSettings = new I2cConnectionSettings(I2cUpsStatusAddress);
upsStatusSettings.SharingMode = I2cSharingMode.Shared;
upsStatusSettings.BusSpeed = I2cBusSpeed.FastMode;

upsStatus = await I2cDevice.FromIdAsync(devices[0].Id, upsStatusSettings);

if (upsStatus == null)
throw new Exception("Unable to open UPS Status on " + I2cUpsStatusAddress);
jgcramer
Posts: 1
Joined: Wed Dec 28, 2016 8:38 pm

Re: Windows 10 IoT Core and UPS PICo

Post by jgcramer » Wed Dec 28, 2016 8:49 pm

Any update? I use Windows IOT for two projecten and like the version 3 board.

What doesent work now?
User avatar
Pimaster
Site Admin
Posts: 1615
Joined: Fri Sep 14, 2012 9:50 am

Re: Windows 10 IoT Core and UPS PICo

Post by Pimaster » Sat Jan 07, 2017 12:57 am

Hi,

Currently I can not support you. I will check with our Linux developer to see if and how we can supply with "daemons" for windows IoT

Warmest Regards
PiM
---
Please read and follow the PiForum rules
viewtopic.php?f=13&t=196
---
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
JoePie
Posts: 1
Joined: Tue Jan 24, 2017 10:08 am

Re: Windows 10 IoT Core and UPS PICo

Post by JoePie » Wed Jan 25, 2017 9:22 am

Pimaster wrote:Hi,

Currently I can not support you. I will check with our Linux developer to see if and how we can supply with "daemons" for windows IoT
gold
Warmest Regards
PiM
---
Please read and follow the PiForum rules
viewtopic.php?f=13&t=196
---
That's fair enough.
Last edited by JoePie on Thu Aug 24, 2017 1:22 pm, edited 1 time in total.
piguy45
Posts: 5
Joined: Sat Nov 05, 2016 11:00 am

Re: Windows 10 IoT Core and UPS PICo

Post by piguy45 » Sat Feb 04, 2017 5:54 am

Pimaster wrote:I will check with our Linux developer to see if and how we can supply with "daemons" for windows IoT
Any update, or basic sample code on how to communicate to the unit via i2c?

Thanks heaps!
User avatar
Pimaster
Site Admin
Posts: 1615
Joined: Fri Sep 14, 2012 9:50 am

Re: Windows 10 IoT Core and UPS PICo

Post by Pimaster » Sat Feb 25, 2017 2:36 am

Go to the GitHUB the code is open so you can try to adopt to your needs
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
Apulus
Posts: 2
Joined: Wed Apr 12, 2017 12:03 am

Re: Windows 10 IoT Core and UPS PICo

Post by Apulus » Wed Apr 12, 2017 12:28 am

Hi to everybody

did anybody succeed in porting the services under windows iot?
I found only this post searching on internet.

Regards
Apulus
Posts: 2
Joined: Wed Apr 12, 2017 12:03 am

Re: Windows 10 IoT Core and UPS PICo

Post by Apulus » Sat Apr 22, 2017 7:30 pm

Hello to Everybody

I did a porting of the module Picofssd in Java script for Windows IOT Core based on the GPIO 22 reading and GPIO 27 for triggering the shutdown.
It was quite complicated as WINDOWS IOT core requires some register modification to allow commanding.

The file is so simple that I include it here (maybe somebody can improve or fix bugs).
An area where I would appreciate clarification is the timing of teh shutdown. Windows IOT is extremely slow and maybe the time allocated of 120 Secs is too little any experience ?

Regards


//javascript porting of PICOFSSD


var uwp = require("uwp");
uwp.projectNamespace("Windows");

var gpioController = Windows.Devices.Gpio.GpioController.getDefault();
var pin = gpioController.openPin(22);
var reset = gpioController.openPin(27);
var currentValueH = Windows.Devices.Gpio.GpioPinValue.high;
var currentValueL = Windows.Devices.Gpio.GpioPinValue.low;


pin.setDriveMode(Windows.Devices.Gpio.GpioPinDriveMode.output);
reset.setDriveMode(Windows.Devices.Gpio.GpioPinDriveMode.input);

function segnalahigh() {
pin.write(currentValueH);
// console.log('high');
}

function segnalalow() {
pin.write(currentValueL);
// console.log('low');
}


function segnala() {
setTimeout(segnalahigh,250);
setTimeout(segnalalow,500);
var spengo = reset.read();
if (spengo == currentValueL) {
// console.log('shutdown');
Windows.System.ShutdownManager.beginShutdown('Shutdown',0 );
}
}


setInterval(segnala,500); // timing
demetr1ce
Posts: 2
Joined: Fri Jul 21, 2017 10:56 am

Re: Windows 10 IoT Core and UPS PICo

Post by demetr1ce » Fri Jul 21, 2017 11:01 am

I have written a bare bones script in C#/.NET to get my PIco UPS running on my Raspberry Pi 3 running Windows IoT. It was adapted from https://github.com/modmypi/PiModules/bl ... s/picofssd and since I suck at Python, this is best I could do :) Hope it helps, cheers.

https://github.com/demetr1ce/PIcoFssd
Post Reply