v15 URLLIB/URLLIB2 urlopen does not work in RpiGPIO event detect callback - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Service Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=152) +---- Thread: v15 URLLIB/URLLIB2 urlopen does not work in RpiGPIO event detect callback (/showthread.php?tid=251901) |
URLLIB/URLLIB2 urlopen does not work in RpiGPIO event detect callback - edup_pt - 2015-12-13 I'm having problems making an urlopen request after RpiGPIO.event_detect triggers the callback in an add-on service that I'm building to kodi (over Rpi2). The callback function is "play" and the callback is settled in the main function with "GPIO.add_event_detect". Code: #Python The callback is triggered but the urlopen always return a type 'NoneType'. Though, when I do the url open without using the callback it works meaning that when I do pooling over the gpis's without the event_detect function, the urlopen works. RpiGpio event_detect callbacks triggers the callback in another thread (http://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/). Any idea why this is happening? Is there any restriction on running url open on a kodi add-on service in another thread? I'm running Kodi, over openelec, over a PI2. Pi2 has internet and url exists. RE: URLLIB/URLLIB2 urlopen does not work in RpiGPIO event detect callback - edup_pt - 2015-12-29 I figured out that RpiGPIO runs the callback in restricted mode meaning that I can't access to any url or file in that instance |