Adding pyserial python libraries for controlling a arduino from XBMC via serial port?
#1
Question 
I fiddling with the idea of controlling an arduino from xbmc via an addon, to do this I need to be able to send command over serial using python.

The problem comes when I add pyserial, I added it to the /system/python/Lib folder as shown on th wiki, but for some reason it calls for 'ctypes', so I have downloaded and added that to the same folder and I get

Code:
File "special://xbmc/system/python/Lib\ctypes\__init__.py", line 10, in ?
from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes

ctypes says is it works on python 2.3+ and is included in 2.5+, so should work on the version 2.4.5 used in XBMC, but it doesn't?
Reply
#2
I have tried using older versions of pyserial and got no where.

I am amazed that no one has tried to control and Arduino from XBMC before (or if they have google can't find it)
Reply
#3
Someone will say that Im repeating myself, but why not:
you should try to make a socket server (xml-rpc or whatever you prefer more) outside of xbmc that will talk with serial port.
From xbmc your addon will be a client talking to socket server.
This approach is more scalable, allowing you to create more than one client to your device (web client, or maybe Android Wink )
Reply
#4
Anyone got this working on frodo yet ?

i think if this is NOT working to do it differently

I have had succes with pyperclip.copy command and import pyperclip

it copys the text or command to clipboard where another program is watching this and emptys the clipboard when commands are received (http://groovygamegear.com/webstore/index...cts_id=239 works this way, but didnt use that because of the 48 steps in stead of 255 steps with arduino)

but i am thinking of, put command in clipboard.
empty clipboard with program in processing or delphi and doe some coding like fading to new value for the light's.

I am starting this on end of the week. keep you posted of progress.

direct serial options are stil welcome :-)
Reply
#5
Hi,

Did you manage to get Serial lib working??

Thanks Smile
Reply
#6
No i have made an DELPHI program to catch the http request made from within a kodi (xbmc) script
So now when i play a movie the light wil dim with an arduino.
I have made an option for android control also and have an option for movi mode on or of (so dimming or not when start movie)

if you like i can send code

using wifi on android uses less power then bluetooth and no extra electronics used :-)
Reply

Logout Mark Read Team Forum Stats Members Help
Adding pyserial python libraries for controlling a arduino from XBMC via serial port?0