It looks like a bug - introduced by garbage on the line. The 'pinmap' array has 6 entries in it, but the variable 'port' can go up to 7. It is possibly a 0xFF garbage byte - I've seen that coming from the usb device before. You need to check the value of port, and if it is invalid, throw the data away and wait for more.
> -----Original Message----- > From: sam sokolik [mailto:sa...@empirescreen.com] > Sent: Saturday, 3 December 2011 9:20 AM > To: Enhanced Machine Controller (EMC) > Subject: Re: [Emc-users] Arduino Communication issues > > so - it seems to be running pretty well now the only issue that I see is every > so often it doesn't seem to create the pins correctly. (I get) > > http://pastebin.com/CvEBeCHg > > snip > Waiting for component 'arduino' to become ready...................... > Traceback (most recent call last): > File "/bin/arduino", line 79, in <module > c['digital-in-%02d' % pinmap[port]] = b != 0 > IndexError: list index out of range > > seems to happen when you close the halvcp and then rerun the hal hal file. > But not very consistant. Like 5% of the time. > > But other than that - it is almost 100% and I normally would not be starting > and stoping the thing that often. It would be loaded when emc starts and > stay running the whole time. > > sam > > On 12/2/2011 4:05 PM, Frank Tkalcevic wrote: > > I had similar problems with an AVR32 running as a CDC device. It > > turned out to be another program grabbing the port - a modem manager > > (from memory). I used synaptic to find and uninstall it. I've also > > read the ACM driver is buggy. I blacklisted it and use the general > > serial device driver. I found most of this on google. > > > > > >> -----Original Message----- > >> From: sam sokolik [mailto:sa...@empirescreen.com] > >> Sent: Saturday, 3 December 2011 2:48 AM > >> To: Enhanced Machine Controller (EMC) > >> Subject: [Emc-users] Arduino Communication issues > >> > >> I thought I would post this on the list as maybe others have run into > >> this issue. It is emc related although I don't think the problem is. > >> I have > > an > >> arduino uno that I want to use mainly as a temperature input into emc. > >> (spindle temp) Plus it gives me some extra non realtime inputs and > > outputs. > >> I Am playing around with what Jeff Epler had done here > >> http://emergent.unpythonic.net/01198594294 > >> > >> When I plug the arduino into the linux box (10.04) it shows up in dev > >> as ttyACM0. That is the port I put in the arduino-vcp.hal file. The > > arduion.py file > >> was renamed to arduino and put in the /bin dir and set as executable. > >> I > > also > >> added myself to the dialout group. > >> > >> Now - when I halrun arduino-vcp.hal I usually have one of 3 outcomes. > >> > >> 1.) the pyvcp pannel opens and everthing seems to work correctly. 10% > >> of the time (estimate) > >> 2.) http://pastebin.com/qVa13VbE (pretty much says it could not open > >> port > >> /dev/ttyACM0 but it is still showing in /dev) 89% of the time > >> 3.) http://pastebin.com/CvEBeCHg (seems to maybe be an issue with the > >> setup of pins within the arduino.py file) 1% of the time > >> > >> Now I have tried this on 2 different computer with the same result. > >> It > > seems > >> the serial port gets locked some how. I did add some rules in the > >> rules.d directory with the same results.. (like I say - the port > >> shows up in > > /dev) > >> Seb had me run a trace on the port 'strace hd /dev/ttyACM0' and got > >> http://pastebin.com/SgMjTbpB > >> > >> I am still searching and searching but am coming up with not good > >> solution yet. > >> > >> Thanks! > >> sam > >> > >> > > ---------------------------------------------------------------------- > > ------ > > -- > >> All the data continuously generated in your IT infrastructure > >> contains a definitive record of customers, application performance, > >> security threats, fraudulent activity, and more. Splunk takes this > >> data and makes sense of > > it. IT > >> sense. And common sense. > >> http://p.sf.net/sfu/splunk-novd2d > >> _______________________________________________ > >> Emc-users mailing list > >> Emc-users@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/emc-users > > > > ---------------------------------------------------------------------- > > -------- All the data continuously generated in your IT infrastructure > > contains a definitive record of customers, application performance, > > security threats, fraudulent activity, and more. Splunk takes this > > data and makes sense of it. IT sense. And common sense. > > http://p.sf.net/sfu/splunk-novd2d > > _______________________________________________ > > Emc-users mailing list > > Emc-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/emc-users > > > > > > ---------------------------------------------------------------------------- -- > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security threats, > fraudulent activity, and more. Splunk takes this data and makes sense of it. IT > sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users