Hi Oliver, thanks for the quick response an patch.
> So the _order_ of the commandline has no effect on the behaviour as you > tried in the two examples in the beginning of this mail. Ah ok. In this case the commandline help is correct ;-) I didn't look deep into the sources what happens exactly... > To fix this behaviour, i would suggest to force a close of the slcan > adapter before setting the bitrate (which is also common for other CAN > adapters/controllers). E.g. by sending > > "C\rS?\r" instead of only "S?\r" > > Then we would have this possible init sequence of slcan_attach: > > CS? -> Cs???? -> O -> (attach tty) -> (wait) -> (detach tty) -> C > > Can you try this (also attached) patch to check whether a 'close' before > setting the bitrate brings back the wanted functionality? Done. Works perfect now! Thanks a lot for the fix. > Btw. when slcan_attach provides some functionality on the commandline, > it > should JUST WORK like expected ;-) Sure! WORKS like expected by the coder ;-))) In the meantime in managed to start/stop this SocketCAN/SLCAN stuff on startup/shutdown by use of an initscript. Therefore i used the skeleton script in /etc/init.d/ and modified it to get all the things i described in my last mail to be executed with that initscript. I am not a real linux or scripting geek, so i am sure that the script has a lot of room for improvement. For those who are interested: http://www.dl9sec.de/dld/SLCANd I put the initscript in /etc/init.d/ and added the entry "61 61 SLCANd" at /var/lib/rcconf/services. Then i executed rcconf and activated "SLCANd" to be started at system startup. Then all the symbolic links are generated for all runlevels. Now it seems to run perfect. When the system is up, slcan0 is present and works fine :-)) By the way: i added a "F\r" to my initstring for the SLCAN to clear the error-LED in case of a pending bus error. So the command looks like this now: echo -e -n "C\rF\rS6\rO\r" > /dev/ttyUSB0 Cheers, Thorsten _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
