![]() ![]() Print 'data from arduino is at the serial port!'ĭef render_GET(self, request): #passes the data from the get request Print 'Arduino device: ', serServ, ' is connected.'ĭef serialReadEvent(self): #maybe it should be: doRead()? Couldn't get either to work. Anyway here is what I have so far: import sysįrom import Factory, Protocolįrom import SerialPort I just cannot seem to find a good example for Twisted Python online to receive serial data or at least an example that I understand. ![]() :/ I have been working on this for a bit over a month and seem to be stuck. I cannot seem to get this code to listen to that same serial port though. The code below runs on the RPi, receives a GET request and passes some of that data through the serial port to the Arduino. I verified that the Arduino is sending chars every 2 seconds with a serial monitor application in the Arduino programmer running on the RPi. However I cannot seem to generate Twisted code which will detect anything coming from the Arduino to the RPi on the serial port. ![]() So far I am able to send from the Raspberry Pi to the Arduino and effectively turn its LED off/on just as expected. I am trying to keep it simple for now and just trying to send a char at any one time between the two devices. I have been working on an Arduino/Raspberry Pi project where I have found myself learning not just Python but Twisted Python as well so I apologize in advance for my newbness. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |