Go to advanced search

by dsyleixa123
Mon Jun 03, 2019 2:12 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

I have no idea, I'm afraid
by dsyleixa123
Mon Jun 03, 2019 1:39 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

now it's initializing... starting UART loop... §&i0=0;&i1;3; §&i0=803;&&i5=-1;&i6=33; §&i0=801;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=802;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; Timeout RX error no data for 1 sec Timeout RX error no data for 1 sec Timeout RX error no data for 1 sec Timeout R...
by dsyleixa123
Mon Jun 03, 2019 12:58 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

same thing for 3000ms send timeout :( §&i0=3967;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=3968;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=3969;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=3970;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=3971;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=39...
by dsyleixa123
Mon Jun 03, 2019 12:38 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

using serialDataAvailable(Serial): §&i0=1362;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=1363;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=1364;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=1365;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; §&i0=1366;&i1=0;&i2=1;&i3=0;&i4=-22;&i5=-1;&i6=33; Timeout TX...
by dsyleixa123
Mon Jun 03, 2019 12:34 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

compile error: there is no
if (Serial.available())
for the Pi
by dsyleixa123
Mon Jun 03, 2019 12:20 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

the code for serialGetchar & serialPutChar I don't know, it's somewhere in wiringSerial I guess...
by dsyleixa123
Mon Jun 03, 2019 12:16 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

I unplugged the Arduino from USB, then again restarted the program from Geany by F5 now it says the same, very quickly no 1 sec delay in between: Timeout error no data for 1 sec Timeout error no data for 1 sec Timeout error no data for 1 sec Timeout error no data for 1 sec Timeout error no data for ...
by dsyleixa123
Mon Jun 03, 2019 12:01 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

firing the Raspi without sending from Arduino: sprintf(mbuf, formatstr, i0,i1,i2,i3,i4,i5,i6 ); //for (int i=0; i<strlen(mbuf); i++ ) Serial.print(mbuf[i]); initializing... starting UART loop... Timeout error no data for 1 sec Timeout error no data for 1 sec Timeout error no data for 1 sec Timeout e...
by dsyleixa123
Mon Jun 03, 2019 11:59 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

as stated (IIRC) the Serial class on Arduino has integrated timeouts, and people who use UART from Arduino to Arduino by Serial() never needed extra ones... (i used that Arduino code to another Aduino already successfully, also from an Arduino to a PC running Borland C++ Builder, just for the Raspi ...
by dsyleixa123
Mon Jun 03, 2019 11:21 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

update: I just let it run about 40 min, and it was fine, not showing either error! Now with an advanced message string from Arduino constructed by int32_t i0=0,i1=0,i2=0,i3=0,i4=0,i5=0,i6=0,i7=0,i8=0,i9=0; // test i0=0; i1=1; i2=-22; i3=33; i4=-444; i5=5555; i6= B10101010*256; i6+=B10101010; char fo...
by dsyleixa123
Mon Jun 03, 2019 7:53 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

thank you, I'll try it immediately! what I hadn't understood at first is that a timeout is needed at all, because the Arduino Serial class (providing available()) has got a built-in timeout and probably many more built-in features, opposite to the wiringPi/wiringSerial thing; tbh, I assumed both wer...
by dsyleixa123
Sun Jun 02, 2019 7:24 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

thank you very much for your hints! Actually the original code was derived from an original Arduino-to-Arduino-Code which already worked fine, and now one Arduino code had been substituted by a Raspi-wiringPi portation. But yes, indeed by the following changes it now works much better: if (serialDat...
by dsyleixa123
Fri May 31, 2019 6:18 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

update:
adding delay(10) instead of (1) doesn't change anything, UART clock 19200 instead neither.

But:
uploading to a Arduino Due (SAM3X8E) it works like a charm, at either clock or delays! :shock:
replugging to the Mega: again always hangs up... :shock:

is that normal to the Mega ? :?
by dsyleixa123
Fri May 31, 2019 8:18 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

yes, thank you, I cut it down to the basic essentials, but now again it stalls after a couple of loops sending there and back: Raspi code: /* UART communication send/receive string of tokens Raspberry Pi master ver 0101 */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string> ...
by dsyleixa123
Thu May 30, 2019 8:45 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

Re: code for UART comm from Pi to Arduino hangs up

any idea anybody why it's stalling?
by dsyleixa123
Thu May 30, 2019 2:48 pm
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 1841

Re: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

it's actually not crucial... if I declare in the strstrpos function char* vname then I can pass from main: char c[30]; strcpy(c, "token") and then passing c is fine, but if I pass just "token" then I get the warning ISO C++ forbids converting a string constant to ‘char*’ . instead, if I declare cons...
by dsyleixa123
Thu May 30, 2019 2:14 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 2436

code for UART comm from Pi to Arduino hangs up

hi, I am despairing, my code for UART comm from Pi to Arduino hangs up. I am trying to send strings built by strcpy(formatstr, "§"); strcat(formatstr, "&i0=%d;&i1=%d;&i2=%d;&i3=%d;\n"); sprintf(mbuf, formatstr, i0,i1,i2,i3); to my Arduino and receive similar ones. At least I get it started, but it s...
by dsyleixa123
Thu May 30, 2019 2:04 pm
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 1841

Re: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

the warning is still
warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
when I remove the "const" vname, in order to be able to pass also char c[] instead of "token"
by dsyleixa123
Thu May 30, 2019 11:36 am
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 1841

Re: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

thank you very much @jahboater, #3 const char* vname resolved the issue! The rest of your advices also have been processed! thx a lot! PS, now passing a char[] as a vname failes (error): char test[30]; strcpy(test, "xpos"); cstringarg(cbuf, test, cval); I think I have to live with the warnings... ;)
by dsyleixa123
Thu May 30, 2019 10:49 am
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 1841

Re: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

yes, it's incomplete, it'a part of a more complex thing: int16_t strstrpos(char * haystack, char * needle) // find 1st occurance of substr in str { char *p = strstr(haystack, needle); if (p) return p - haystack; return -1; // Not found = -1. } char * cstringarg( char* haystack, char* vname, char* sa...
by dsyleixa123
Thu May 30, 2019 10:24 am
Forum: C/C++
Topic: avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’
Replies: 24
Views: 1841

avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’

hello, how can I avoid compile warnings about ISO C++ forbids converting a string constant to ‘char*’ ? as I am using C functions like char * strstr ( ); I need using char * , but when call the function then I need to pass e.g. both char haystack[256]="ljdsfwfjassHSIZSWQSDDHGGtoken=kogpogpomz"; char...
by dsyleixa123
Sat May 11, 2019 6:02 am
Forum: C/C++
Topic: Creating a Raspberry Pi program in Qt Creator
Replies: 25
Views: 2141

Re: Creating a Raspberry Pi program in Qt Creator

Heater wrote:
Fri May 10, 2019 6:19 pm
However, uncouth and rude feedback makes that impossible in your case. Good luck.
what do you expect in reply to hollow and snooty statements like
A quick google search will find you hundreds of links
:?
by dsyleixa123
Fri May 10, 2019 5:17 pm
Forum: C/C++
Topic: Creating a Raspberry Pi program in Qt Creator
Replies: 25
Views: 2141

Re: Creating a Raspberry Pi program in Qt Creator

In this case I felt that trying to give directions here would only be a repetition of what is found in seconds on all over the net already either show me the detailed install steps and the single settings for "tools" or move on. in case not, I'll make a note not to bother you with any help in futur...
by dsyleixa123
Thu May 09, 2019 8:16 am
Forum: C/C++
Topic: Creating a Raspberry Pi program in Qt Creator
Replies: 25
Views: 2141

Re: Creating a Raspberry Pi program in Qt Creator

I tried all I could find but all in vain
tbh, 1st of all: I didn't ask you but the OP,
and 2nd, posts like yours which say "try to google" are actually rediculous.
by dsyleixa123
Wed May 08, 2019 7:36 pm
Forum: C/C++
Topic: Creating a Raspberry Pi program in Qt Creator
Replies: 25
Views: 2141

Re: Creating a Raspberry Pi program in Qt Creator

I'm curious if you managed to install qt5 and qtcreator - I once tried but failed completely...: sudo apt-get install qt5-default // edited: c+p typo sudo apt-get install qtcreator After choosing file...new..Projects...Qt-Widgets-Project (acually shown installed German option names) and after enteri...

Go to advanced search