Berat Uslu Posted November 30, 2017 Posted November 30, 2017 Hello guys, I am trying to blinking POWER_LED on my orange pi lite using google firebase but I couldn't find any resources on internet.... Here is my armbian info; http://sprunge.us/RhTM I want to develop ioT application using orange pi zero coz it has internal ethernet and wifi connection options and it is cheap. What I want to learn is: - I want to develop my ioT application using python - which version OS I should load - proper GPIO or related library for controlling GPIOs and rs-485 and i2c communications Thanks.
chwe Posted December 2, 2017 Posted December 2, 2017 On 30.11.2017 at 3:59 PM, Berat Uslu said: I want to develop ioT application using orange pi zero coz it has internal ethernet and wifi connection options and it is cheap. Quote Known issues Onboard wireless module (XR819) has poor software support so wireless connection issues are expected On 30.11.2017 at 3:59 PM, Berat Uslu said: - proper GPIO or related library for controlling GPIOs and rs-485 and i2c communications https://github.com/chwe17/pyGPIO/ still in testing phase, but should work (except RS-485)
Berat Uslu Posted December 4, 2017 Author Posted December 4, 2017 On 12/2/2017 at 8:33 AM, chwe said: https://github.com/chwe17/pyGPIO/ still in testing phase, but should work (except RS-485) is there any way to use rs-485 with orange pi zero?
martinayotte Posted December 4, 2017 Posted December 4, 2017 RS485 has nothing to do with GPIOs, except if you do software serial bitbanging... The easiest way to get a RS485 bus on any SoC boards is to use USB-RS485 dongle such those : https://www.ebay.ca/itm/CH340G-Chip-USB-to-RS485-485-Converter-Adapter-For-Win7-Linux-XP-Vista-top-M94/351494358967
Berat Uslu Posted December 4, 2017 Author Posted December 4, 2017 5 minutes ago, martinayotte said: RS485 has nothing to do with GPIOs, except if you do software serial bitbanging... The easiest way to get a RS485 bus on any SoC boards is to use USB-RS485 dongle such those : https://www.ebay.ca/itm/CH340G-Chip-USB-to-RS485-485-Converter-Adapter-For-Win7-Linux-XP-Vista-top-M94/351494358967 I want to communicate arduinos using max485 module... is it possibble? at the same time I have to use i2c. I would like to do this using orange pi zero.. is it possibble?
martinayotte Posted December 4, 2017 Posted December 4, 2017 21 minutes ago, Berat Uslu said: I want to communicate arduinos using max485 module... is it possibble? Of course, it is possible ... But, again, RS485 itself has nothing to do with GPIOs ... With MAX485 module, you need to manage DE/RE signals by yourself with some GPIOs, with USB-RS485, it handling that itself, this is why I said the USB dongle is the easiest way !
Berat Uslu Posted December 4, 2017 Author Posted December 4, 2017 1 minute ago, martinayotte said: Of course, it is possible ... But, again, RS485 itself has nothing to do with GPIOs ... With MAX485 module, you need to manage DE/RE signals by yourself with some GPIOs, with USB-RS485, it handling that itself, this is why I said the USB dongle is the easiest way ! So I had decided to go with Rasp pi zero but. they are selling it very expensive on the other hand orange pi development side looks weak.. at the and I had to re-consider orange pi... i think it will be orange pi zero.. can you help me to build this project? coz there is no much resource on internet...
martinayotte Posted December 4, 2017 Posted December 4, 2017 I don't see where is the challenge here since OPiZero has USB available on the expansion head, so you only need a USB breakout connector along with USB-RS485 dongle, hits means a total of less than US$1.50.
Berat Uslu Posted December 4, 2017 Author Posted December 4, 2017 1 hour ago, martinayotte said: I don't see where is the challenge here since OPiZero has USB available on the expansion head, so you only need a USB breakout connector along with USB-RS485 dongle, hits means a total of less than US$1.50. I am newbie on SoC boards. Challenge is, really I don't know how to start coding. lets assume I will use USB-RS485 dongle and usb breakout connector. Can you please provide me code example for: - RS485 communication - i2c communication - Basic GPIO led example for all of this list items, code example and libraries. at least you can give me a starting point. I will be appreciated.
martinayotte Posted December 4, 2017 Posted December 4, 2017 For RS485 using USB Dongle, the port simply appears as /dev/ttyUSB0 and you can use python serial to access it. import serial port = serial.Serial("/dev/ttyUSB0", 115200, timeout=1) port.write("Hello World"); port.close() For I2C and GPIO, I suggest to look at this library : https://github.com/duxingkei33/orangepi_PC_gpio_pyH3
Berat Uslu Posted December 4, 2017 Author Posted December 4, 2017 5 minutes ago, martinayotte said: For RS485 using USB Dongle, the port simply appears as /dev/ttyUSB0 and you can use python serial to access it. import serial port = serial.Serial("/dev/ttyUSB0", 115200, timeout=1) port.write("Hello World"); port.close() For I2C and GPIO, I suggest to look at this library : https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 ok I will try to get examples work. thank you very much. Can I ask additional questions when I need?
Berat Uslu Posted December 4, 2017 Author Posted December 4, 2017 10 minutes ago, martinayotte said: For RS485 using USB Dongle, the port simply appears as /dev/ttyUSB0 and you can use python serial to access it. import serial port = serial.Serial("/dev/ttyUSB0", 115200, timeout=1) port.write("Hello World"); port.close() For I2C and GPIO, I suggest to look at this library : https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 orangepi_PC_gpio_pyH3 library says it is "ALLwinner H3 base" but OPI zero H2 will it work?
chwe Posted December 4, 2017 Posted December 4, 2017 1 hour ago, Berat Uslu said: orangepi_PC_gpio_pyH3 library says it is "ALLwinner H3 base" but OPI zero H2 will it work? doesn't matter for your use case but pinmapping of OPi PC and OPi 0 is different. There's a version of the same lib for the OPi0 somewhere on github (forgot the link). You can use pyGPIO which is more or less the same lib (naming of the used pins differs a little bit, but OPi0 is supported). 2 hours ago, Berat Uslu said: Can you please provide me code example for: - RS485 communication - i2c communication - Basic GPIO led example I suggest you go through the basic examples of the libs you use to improve your python skills a little bit. Otherwise, you'll need support everytime something doesn't work 'out of the box'.
Recommended Posts