Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 4999|Reply: 0

Display the IP Address of Orange Pi with this LED IP Address Module

[Copy link]

2

Threads

3

Posts

90

Credits

Registered member

Rank: 2

Credits
90
Post time 2016-4-21 12:57:50 | Show all posts |Read mode
All of the work in the development of the IP Address Module and the subsequent code and documentation are the work of Jason Mann.  His
installation instructions work perfectly on the Raspberry Pi.

I took the crazy step of attempting to install his module into an Orange Pi.  I encountered some interesting roadblocks and hurdles.  My
gratitude goes out to Jason who was a tireless source of help and ideas in getting over the coding hurdles and to my good friend and co-
worker Michael Smeyer for his functional knowledge of Linux in helping me get through many of the general stumbling points.

The world of Orange Pi is an unstable one, with likely 1% or less of the community size owning, using and developing resources.  There
are a handful of extremely dedicated folks working in this arena.  Special thanks to Laboris for his work on the Ubuntu image and to
WareCatF and others for their work on the WiringOP library.

There are a few challenges in getting the module to work on an Orange Pi:

Installation

Support Packages need to be updated and installed

IP_Address Module Installation and customization

Installation -

Install the IP Address module - carefully!  The GPIO pin header is installed "backwards" on the Orange Pi compared to the Raspberry Pi.  
On the Raspberry Pi, pin 1 of the header is in the "inside" side of the Pi whereas on the Orange Pi, pin 1 of the header is on the
outside edge of the board.  The module will not mount over the board but will hang over the side.  The Orange Pi PC has pin one on the
inside but it is reverse order from the Raspberry Pi.  The IP Address module will sit over the board, not hang over the edge.  In either
case, install pin 1 of the IP Address module to pin 1 of the GPIO header and pin 25 to pin 25 and you're all set.  

I used the Laboris image - Ubuntu-Vivid (Ubuntu Mate)

Initial power up:

After installing the module, apply power to the Orange Pi.  The system should boot normally.  The display should cycle through a count up
of 001 through 004 and repeat.

Support Package update and installation -

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install build-essential
sudo apt-get install automake
sudo apt-get install make
sudo apt-get install git
sudo apt-get install python-numpy  (*** NOTE This library is needed by the python-smbus installed as part of Jason's instructions.  The
distro I used was missing python-numpy. ***)
git clone https://github.com/zhaolei/WiringOP.git -b h3

cd WiringOP
chmod +x ./build
sudo ./build

The test:
gpio readall

The next test:

sudo i2cdetect -y 0
sudo i2cdetect -y 1

One of these two commands should generate a result of 5a in the grid.

IP_Address Module Installation and customization -

Once the script successfully builds and the test runs, it's time to install support for the IP Display
From Jason's installation manual (with minor modifications):

sudo apt-get update
sudo apt-get install python-smbus i2c-tools (*** Note - you may see a message that i2c-tools is already the most current version from

having installed the WiringOP.git.  Just say "Y" to the install ***)

git clone https://github.com/tuxmann/Raspberry_IP_Addr.git

sudo nano /etc/modules

Install communications software to talk to the Pi IP address board
Add these lines to the modules file:

i2c-bcm2708
i2c-dev

Ctrl-X and save


Enable I2C communication
sudo nano /etc/modprobe.d/raspi-blacklist.conf

Comment out the line that says blacklist i2c-bcm2708 by preceeding it with a # sign
(note - there is no raspi-blacklist.conf in Opi.  The blacklist.conf file has an i2c-1801 blacklisted but it should not be remarked out)

sudo nano /pathtoRaspberry_IP_Addr folder/hostip.py
change the line that says: bus = smbus.SMBus(1) # 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)
to say bus = smbus.SMBus(0) # 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)
Exit and save

Gain root access and add the python script to run at startup

sudo su
crontab -e

Add this line to chrontab:

@reboot python /home/orangepi/Raspberry_IP_Addr/hostip.py

in my case, the path to hostip.py is different - use the appropriate path:  @reboot python
/home/orangepi/WiringOP/Raspberry_IP_Addr/hostip.py

(*** you may have to sudo nano crontab to add the line.  If the line does not stay, use sudo crontab -e)

sudo reboot

On reboot, the module should cycle through 001 002 003 004 during intitial power up.  When the hostip.py program runs, the display will
cycle through 255 000 until an IP address is assigned.  Once the system has it's IP address, the display will cycle through the four
octets of the address.  





The SD card is interchangeable between the OPi One and the OPi PC.  It is critical to make sure that the module is installed Pin 1 to Pin
1 on the GPIO pins.  The GPIO pins are rotated 180 degrees from the One to the PC so when installing on the PC, the module sits above
the board but when installing on the One, it hangs over the side.  A 26 pin tall Header adapter makes it possible to install the module
for either board with the OPi being installed in a case.

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2020-7-11 12:45 GMT+8 , Processed in 0.028179 second(s), 24 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list