Go to advanced search

by Stiller
Thu May 10, 2018 5:50 pm
Forum: C/C++
Topic: wiringSerial usage
Replies: 9
Views: 2522

Re: wiringSerial usage

I got it working much better, no sync-in failure any more FTM, I changed it like this: c=0; while(serialDataAvail( Serial )<MSGSIZE) ; for(int i=0; i<MSGSIZE; i++) { ibuf=serialGetchar( Serial ); if(i==0 && ibuf!=bsync) { c=-1; serialFlush( Serial ); break; } else if(ibuf>=0) { cbuf[i]=(uint8_t)ibuf...
by Stiller
Thu May 10, 2018 5:05 pm
Forum: C/C++
Topic: wiringSerial usage
Replies: 9
Views: 2522

Re: wiringSerial usage

if it once has started, then everything is like expected. But sometimes it does not start the communication correctly. Then I see in the console sth like: send: 10 21 receive error send: 10 21 receive error send: 10 21 receive error send: 10 21 receive error send: 10 21 receive error send: 10 21 rec...
by Stiller
Thu May 10, 2018 4:41 pm
Forum: C/C++
Topic: wiringSerial usage
Replies: 9
Views: 2522

Re: wiringSerial usage

yes, I can read and test the content by sending to Arduino, Arduino changes some cells (+1) and sends back, then I receive and read and change on the Pi (+10), send back, a.s.o. That works more or less as stated. Just the start hangs sometimes. But when it starts correctly, then it works fine the re...
by Stiller
Thu May 10, 2018 4:15 pm
Forum: C/C++
Topic: wiringSerial usage
Replies: 9
Views: 2522

Re: wiringSerial usage

Use an oscilloscope or a digital analyser or piscope to sniff the traffic. http://abyz.me.uk/rpi/pigpio/piscope.html I don't have an oscilliscope and have no idea how to sniff the traffic. But it works now more or less, but sometimes it's not easy to sync the data (array[0] is always 255, and I hav...
by Stiller
Thu May 10, 2018 3:26 pm
Forum: C/C++
Topic: wiringSerial usage
Replies: 9
Views: 2522

Re: wiringSerial usage

hi, thank you! I couldn't get any values to read, now still the same even if I changed char to int8_t but I will try 1 different thing now and see what will happen: c=0; while(serialDataAvail( Serial )<MSGSIZE) for(int i=0; i<MSGSIZE; i++) { ibuf=serialGetchar( Serial ); if(ibuf>=0) { cbuf[i]=(uint8...
by Stiller
Thu May 10, 2018 2:34 pm
Forum: C/C++
Topic: wiringSerial usage
Replies: 9
Views: 2522

wiringSerial usage

hello, I do not understand the logic for the usage of the wiringSerial functions. Unfortunately I do not find a matching/suitable source code example on the home page. I want to read an array (from an Arduino) from Serial #include <wiringPi.h> #include <wiringSerial.h> char * uart = "/dev/ttyACM0"; ...
by Stiller
Mon Jan 29, 2018 8:59 am
Forum: C/C++
Topic: Error when executing .c file in Raspi3
Replies: 13
Views: 2060

Re: Error when executing .c file in Raspi3

hello, does this example work for you? IIRC, it once worked successfully: GPIO4 P7 ——– DATA (S) /* * dht11.c: * Simple test program to test the wiringPi functions * DHT11 test */ #include <wiringPi.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #define MAXTIMINGS 85 #define DHTPIN 7 i...
by Stiller
Wed Jan 24, 2018 12:44 pm
Forum: C/C++
Topic: wiringPi I2C libs wiringPiI2C: block read / write commands?
Replies: 3
Views: 1945

Re: wiringPi I2C libs wiringPiI2C: block read / write commands?

it's supposed to work with read / write
- read / write from a file descriptor
#include <unistd.h>
ssize_t read(int fd, void *buf, size_t count);
ssize_t write(int fd, const void *buf, size_t count);

https://linux.die.net/man/2/read
https://linux.die.net/man/2/write
by Stiller
Sun Dec 24, 2017 1:27 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 4892

Re: stretch wiringpi

That is all very well but still does not explain why gcc could not find wiringPi. I suspect that /usr/local/lib has something to do with it. I did not have /usr/local/lib in my /etc/ld.so.conf even though I am running an uptodate raspbian. Am I wrong in assuming that the something, if including wir...
by Stiller
Sun Dec 24, 2017 11:16 am
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 4892

Re: stretch wiringpi

Just in case you still have a mess, the following helped me get sorted. Got it working by doing the following. Read about /usr/local/lib . I quote the original document below. Some distributions do not have /usr/local/lib in the default LD_LIBRARY_PATH. To fix this, you need to edit /etc/ld.so.conf...
by Stiller
Sun Dec 24, 2017 10:37 am
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 4892

Re: stretch wiringpi

We have lost the plot I am afraid. As we all seem to be solving problems with little reference to my original question I think that this thread should be closed and Ill start again. Apparently the solution is to serach for wiringPi using apt and then wiringPi is not lost. Suggestion by buja a littl...
by Stiller
Fri Dec 08, 2017 12:14 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

I understand what you mean, but you should not expect that. The examples you mention all have in common that they are easy to use as long as you stick to the use case the makers had in mind, the perfect regular consumer. This consumer should stay inside the box and use the package manager to instal...
by Stiller
Fri Dec 08, 2017 10:43 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

Of course I know that Unix is not by IBM (but SCO IIRC), and that now Apple OS also uses kind of Unix (nonetheless, also the first proprietary Mac OS was advertized by the slogan "Think different", in reply to IBM's "Think" ) but my statement (rephrasing the slogans) was just meant to riscrivere the...
by Stiller
Fri Dec 08, 2017 8:43 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

System stuff in system folders, user stuff in local folders. wiringPi is wiringPi (analogously similar programs and libs), so why have 2 different install root dirs and 1 extra in a home dir? But after all that wouldn't matter if there was a system GUI dashboard for overview and uninstall functions...
by Stiller
Thu Dec 07, 2017 6:53 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

I have to disagree - IMO there should be just 1 default install path for all, i.e. all libs into "/usr/lib" by default That's where WiringPi goes if you install it with sudo apt install wiringpi . If you pull a copy from Gordon's repo and build that (with his supplied script with no parameters) it ...
by Stiller
Thu Dec 07, 2017 3:54 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

I have to disagree - IMO there should be just 1 default install path for all, i.e. all libs into "/usr/lib" by default (either if git or apt install). And then there should be an overview menu like in Windows for everything which once has been installed, and an uninstall function to uninstall either...
by Stiller
Thu Dec 07, 2017 10:43 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

The "/home/pi/wiringPi" is the directory where you downloaded the source and compiled the old version that ended up in "/usr/local/lib". You can probably delete it. thank you, I removed this "/home/pi/wiringPi" folder and wiringPi still works. But tbh, as to those installations and all those folder...
by Stiller
Tue Dec 05, 2017 12:22 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

hi, As stated, I have now installed the apt-get version and (probably) removed the former git clone version. Now I just found out that there are still 2 files "wiringPi.h": sudo find / -iname wiringPi.h \home\pi\wiringPi\wiringPi\wiringPi.h \usr\include\wiringPi.h is that correct? Is one of them red...
by Stiller
Tue Nov 21, 2017 1:42 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

there are no .c files in there, but I assumed they should be elsewhere, related to the corresponding .h files, and then to be deleted as well. But ok, as to the .h files IIUC I actually do have to delete them but just the duplicate ones. In fact about half a dozen files were not duplicate, some less...
by Stiller
Tue Nov 21, 2017 1:02 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

not sure if I understood you correctly:
did you mean that I have to delete all the *.h header files in "/usr/local/include" additionally?
If yes, what about the *.c ones?
by Stiller
Tue Nov 21, 2017 12:54 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

the #includes only look like #include <wiringPi.h> no paths at all. I once followed the installation guide on the wiringPi website, at that time no apt install had been mentioned (just the git thing and the .tar) But even now they are misleading and ambiguous as there are now 3 ways how to install, ...
by Stiller
Tue Nov 21, 2017 12:34 pm
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

thanks a lot! indeed, "libwiringPi.so" exist, not "wiringPi" though as I assumed. In fact there are 2 of them listed, just as you already stated, both in "/usr/local/lib" as well as in "/usr/lib". Now how to get rid of the false one? Just delete this .so in "/usr/local/lib" or which is the correct p...
by Stiller
Tue Nov 21, 2017 10:35 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

hell what a mess!
That's why I asked what to do, which steps from A to Z... :-/

But there is nothing called "wiringPi", no file and no directory, neither in "/usr/local/lib" nor in "/usr/lib".
where do I have to look exactly?
by Stiller
Tue Nov 21, 2017 10:13 am
Forum: C/C++
Topic: how to update or reinstall wiringPi of either prior installation source
Replies: 33
Views: 5754

Re: how to update or reinstall wiringPi of either prior installation source

hmm, well - I now simply typed
sudo apt-get install wiringPi
in the console (no uninstall before, just install over the existing files), then it did some certain things, and after that
apt list wiringPi
echoes "...installed"
Now it seems to be ok again, isn't it?

Go to advanced search