Go to advanced search

by Patm
Mon Apr 02, 2018 4:54 am
Forum: Other programming languages
Topic: Arduino IDE/C Variant On Pi?
Replies: 3
Views: 707

Re: Arduino IDE/C Variant On Pi?

I've not tried it myself but I hear QT creator uses a modified C++ that takes care of some of the worst grunt work.
by Patm
Sat Mar 31, 2018 3:34 pm
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Lol, nothing is ever easy. Seems something as simple as passing two bytes is turning into a major endeavor thanks to that char*. I can find lots of links telling me to use the MarshallAs bit but not a single one that tells me how to pass two bytes to it without just ending up with multi-character st...
by Patm
Sat Mar 31, 2018 7:48 am
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Found it. char * buf becomes [MarshalAs(UnmanagedType.LPStr)] string buf
by Patm
Sat Mar 31, 2018 5:12 am
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

TADA! Got it started. I'll post what I got then shut up until I have a full working C# wrapper (at least for I2C). Of course I was just looking for non negative return values so I probably have lots more to figure out but it's a start! In form_load I use this: _piHandle = Init.pigpio_start(null,null...
by Patm
Sat Mar 31, 2018 4:55 am
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Well I figured out that I was importing from the wrong library. instead of libpigpio.so I'm thinking it should be libpigpio_if2. Just have to figure out how to initialise the system since gpioinitialise() (or whatever the name was) doesn't exist in the new library. I get negative results from pigpio...
by Patm
Sat Mar 31, 2018 4:10 am
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Well, it's working. With simple dllimport() work I've got gpioInitialise() and i2cOpen() working. The only problem is that pesky root privileges problem. I can build remotely and run locally with sudo but can't use MonoRemoteDebugger because it's not root. I keep reading everywhere that this problem...
by Patm
Fri Mar 30, 2018 10:34 pm
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Well thanks for trying to help. You did identify the problem. I used danriches/WiringPi.Net wrapper to figure out how to use the C library then I was expanding from there until I hit this limitation of wiringPi. I don't see any C# wrappers for pigpio but if it can be done for wiringpi (and it was wa...
by Patm
Fri Mar 30, 2018 9:08 pm
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

I'm using C# with Winforms so python is not an option. I've used python in the past with some success but honestly I just can't stand the language and would end up shooting _self before I came close to finishing.
by Patm
Fri Mar 30, 2018 6:49 pm
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Yep. Just found it in the wiringPi source and it looks like he never developed I2C past 8 bit operations properly. I already knew his read 16 bit was incomplete as it didn't handle endian types. If I were a C programmer I'd fix it up and submit but I'm not... Maybe I'll have a go at pigpio since it ...
by Patm
Fri Mar 30, 2018 6:33 pm
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Yes I think you're right - you just jogged a memory from long ago about that. I'll have to see if wiringPi does larger than 8 bit reads.
by Patm
Fri Mar 30, 2018 5:23 pm
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

Re: wiringPi and I2C, stuck at sending blank read command

Your code works fine so I know the device isn't messed up. You made me realize I'm supposed to get 8 bytes, not four, with every second byte being the CRC. I changed the code to read 8 but I still get nothing but zeros in every byte. I'm sure the WriteByte() and ReadByte() work properly or I wouldn'...
by Patm
Fri Mar 30, 2018 4:31 pm
Forum: Other programming languages
Topic: wiringPi and I2C, stuck at sending blank read command
Replies: 15
Views: 1288

wiringPi and I2C, stuck at sending blank read command

I'm working with an Si7021 and I'm able to read the temp and humidty no problem but I'm stuck at trying to read the serial number. The problem is that I think I'm supposed to send a blank read and I can't figure out how. I've attached the table showing how it's supposed to work. The whole procedure ...
by Patm
Mon Mar 26, 2018 12:54 am
Forum: Other programming languages
Topic: wiringPi.Net and I2C using C#
Replies: 0
Views: 413

wiringPi.Net and I2C using C#

Just in case anyone else is searching for answers. wiringPi.net's I2C functionality seems to be incomplete. It includes 16 bit reads through I2C.wiringPiI2CReadReg16() but there are no overloads to get signed words or to deal with endian type. Not having dealt with I2C in years I was almost starting...
by Patm
Sun Mar 25, 2018 2:53 pm
Forum: Other programming languages
Topic: C# tool chain?
Replies: 1
Views: 497

Re: C# tool chain?

I figured it out - Keep the project files on a Samba share and you can build from the PC then navigate to the bin directory on the Pi and run the program. I guess VS is looking for the libraries on the machine the project resides on rather than the one VS is running on because it doesn't have any pr...
by Patm
Sun Mar 25, 2018 2:47 pm
Forum: Other programming languages
Topic: C# WiringPi - unable to load libwiringPi.so
Replies: 8
Views: 1444

Re: C# WiringPi - unable to load libwiringPi.so

I don't have wiringPi on the PC, don't think it exists except as a fake that gives you the ability to compile but the functions would be all empty. What I did was create a samba share on the Pi and put the project there. I only load the project from the Pi. I can then use build (running doesn't work...
by Patm
Sat Mar 24, 2018 12:44 pm
Forum: Other programming languages
Topic: C# WiringPi - unable to load libwiringPi.so
Replies: 8
Views: 1444

Re: C# WiringPi - unable to load libwiringPi.so

Just had a thought, are you running the program locally on your PC or from the command line on your Pi?
by Patm
Fri Mar 23, 2018 11:57 pm
Forum: Other programming languages
Topic: C# WiringPi - unable to load libwiringPi.so
Replies: 8
Views: 1444

Re: C# WiringPi - unable to load libwiringPi.so

Well I was just trying it out. The default package doesn't seem to even have a libwiringPi.o so I removed it and cloned wiringPi's git repository according to their instructions at http://wiringpi.com/download-and-install/ From there I went into the wiringPi directory and found all the .o files and,...
by Patm
Fri Mar 23, 2018 10:43 pm
Forum: Advanced users
Topic: RealVNC as recommended?
Replies: 2
Views: 224

Re: RealVNC as recommended?

Real must be funding the Pi. I just sudo apt-get remove realvnc* Then install tightvncserver.
by Patm
Fri Mar 23, 2018 10:40 pm
Forum: Beginners
Topic: PiPackage show only installed?
Replies: 2
Views: 162

PiPackage show only installed?

Trying to use PiPackage to clear out a lot of unused packages is taking forever! Is there an option somewhere to show only installed packages? I've been searching through the menus etc and I'm not spotting one. Failing that, is there a different GUI package manager that will display on the official ...
by Patm
Fri Mar 23, 2018 4:56 pm
Forum: Windows 10 for IoT
Topic: Is there a Winforms(ish) GUI designer for iot?
Replies: 2
Views: 612

Re: Is there a Winforms(ish) GUI designer for iot?

I've been trying that but some containers just disappear and I have to modify them in code. Can't resize a textbox despite putting in widths and heights. Haven't even gotten to trying to dynamically set control contents... Ugh.

Edit: Said textblock but meant textbox.
by Patm
Thu Mar 22, 2018 3:50 am
Forum: Windows 10 for IoT
Topic: Is there a Winforms(ish) GUI designer for iot?
Replies: 2
Views: 612

Is there a Winforms(ish) GUI designer for iot?

The answer is most likely no according to google but hey, I've managed to miss important information in google searches before from a lack of knowing the exact words to search with. Is there a non XAML/WTF Presentation Foundation way of creating a GUI for IoT? Something more Winforms like where butt...
by Patm
Thu Mar 22, 2018 3:44 am
Forum: Other programming languages
Topic: C# WiringPi - unable to load libwiringPi.so
Replies: 8
Views: 1444

Re: C# WiringPi - unable to load libwiringPi.so

First question - did you install wiringpi?
by Patm
Thu Mar 22, 2018 3:29 am
Forum: Other programming languages
Topic: C# tool chain?
Replies: 1
Views: 497

C# tool chain?

I've spend a very frustrating several days trying to figure out how I can develop C# gui software for use on the RPI using my Windows desktop. I've got my Pi set up with mono and wiringpi and packages to let me access gpio etc but I can't even refer to the libraries when coding on the desktop machin...

Go to advanced search