tvlooy/weather-station - GitHub

https://github.com/tvlooy/weather-station

Pricing and Signup Explore GitHub Features Blog Login

Watch Fork 1 1 Source Commits Network Pull Requests (0) Issues (0) Graphs Branch: master Switch Branches (1) master ✓ Switch Tags (0) Branch List Downloads HTTP Git Read-Only

Read-Only access
add ioctl example

tvlooy (author) February 21, 2011 commit 77bee456db5c51a86f2f tree d6907f826f9bcf2bd9d4 parent db668af741d85bce343a weather-station / history message openbsd/ February 21, 2011ioctl led example [tvlooy] LICENSE January 20, 2011 info about net4801 gpio [tvlooy] READMEFebruary 21, 2011add ioctl example [tvlooy] README name age
1 sur 5 27/06/2011 14:59

Please read the file LICENSE for more information.050" header with 12 programmable general purpose input/output pins and com2 serial port access at TTL level. It's an old release.htm . User I/O. To keep it exciting. Station 1: ---------The first version of the station is be based on a Soekris Engineering net4801.soekris.http://www. I'm not going to disclose all my plans.http://wiki. in the end. please see the PC87366 datasheet for programming information and electrical specifications. Let's see what information dmesg has about GPIO: [root@casper ~] # dmesg | grep -i gpio gpio0 at gscpcib0: 64 pins nsclpcsio0 at isa0 port 0x2e/2: NSC PC87366 rev 9: GPIO VLM TMS gpio1 at nsclpcsio0: 29 pins 2 sur 5 27/06/2011 14:59 .pdf Basically it's an i386 device with an AMD Geode CPU (234 MHz) and 128 MB RAM. The weather station relies on sensors to measure temperature and other stuff.7.GitHub https://github. You can find details about the net4801 (which is end of life by the way) at: . Introduction: ------------I want to explore some technologies.tvlooy/weather-station . at the "JP5" text.com/tvlooy/weather-station Weather station: ================ Legal information: -----------------This project and all code and documentation attached to it are subject to the ISC license. The following is taken from the net4801 manual: JP5. I'm able to play with all the things I had in mind. What I'm interested in is the board's GPIO pins. But. The pinout that is in the 4801 manual seems incorrect.com/net4801. this repository will contain code and information to make yourself a nice weather station. you need to refer to the pinout that is on the wiki of the "net5501 JP5 GPIO mappings" for working values: . It should be relatively easy to attach sensors to these pins.http://www. 20 pins 0. pin 1 is the top left pin.3V Power | 1 | 2 | +5V Power | -| | GPIO 16 | GPIO 3 | 3 | 4 | GPIO 4 | GPIO 17 | | GPIO 18 | GPIO 5 | 5 | 6 | GPIO 6 | GPIO 19 | | GPIO 20 | GPIO 7 | 7 | 8 | GPIO 8 | GPIO 21 | | GPIO 22 | GPIO 9 | 9 | 10 | GPIO 10 | GPIO 23 | | -| GND | 11 | 12 | GPIO 12 | GPIO 04 | | GPIO 05 | GPIO 13 | 13 | 14 | GND | -| | GPIO 11 | GPIO 15 | 15 | 16 | GPIO 16 | GPIO 16 | | -| GND | 17 | 18 | RXD | -| | -| TXD | 19 | 20 | GND | -| +-------------+-------------+-----+------+-----------+-------------+ OpenBSD: -------The device is running OpenBSD 4. They are connected directly to the PC87366 Multi-IO controller.info/Net5501_JP5_GPIO_Mappings +-------------+-------------+------------+-----------+-------------+ | PC87366 Pin | Function | Pin Number | Function | PC87366 Pin | +-------------+-------------+-----+------+-----------+-------------+ | -| +3. When the board is viewed as on the illustration (ethernet ports facing you).com/manuals/net4801_manual. but that's not really relevant for what I'm doing with it at the moment.soekris.soekris. By developing a weather station.

org/cgi-bin/man. I attached an LED to the pin.securelevel: gpioctl gpio1 attach gpioow 21 0x01 When I reboot the system.org/cgi-bin/man.owtemp0: # sysctl hw. you can use the sysctl(3) subroutine.cgi?query=gpio .cgi?query=gpioow http://www.securelevel: gpioctl gpio1 17 set out pp As you can see.http://www.openbsd.temp0=24. GPIO pins have to be enabled in securelevel lower than 1. An example to toggle a LED can be found in "openbsd/toggle/blink.openbsd. so you have to enable the pin in /etc/rc.http://www.org/cgi-bin/man.openbsd.org/datasheet/maxim/DS18B20. 3 sur 5 27/06/2011 14:59 . the PC87366 chip is found at gpio1. Then. I attached the data pin of the thermometer to gpio pin 21 and attached a onewire(4) bus on a gpioow(4) device on pin 21. gpioctl gpio1 17 on Sensor: ------The DS18B20 is a digital thermometer with a 1-Wire interface. the gpioctl command will notice the pin: # gpioctl /dev/gpio1 /dev/gpio1: 1 pins To test if this worked. you can use the following command with parameter 'on'.owtemp0.GitHub https://github.sektion=3 Take a look at the file "openbsd/temperature/read. But that's awesome.openbsd. The default securelevel is 1.tvlooy/weather-station .sensors.org/cgi-bin/man.cgi?query=nsclpcsio On OpenBSD. Information on how to use the routine is in the manpage: .pdf To read the temperature from a C program.openbsd.org/cgi-bin/man.http://www.c" for an example.org/cgi-bin/man. Here are some relevant manpages: .19 degC (sn 000001b3da23) Here is some reference material on the 1-Wire stuff: http://en.sensors. you can just read it with the sysctl(8) command.openbsd.cgi?query=owtemp The exact details on how to connect the sensor's pins can be found in the DS18B20 datasheet. 'off' or 'toggle'. reboot.com/tvlooy/weather-station We don't need device gpio0. To set the LED value. you have to use the GPIO Pin number (17) and not the JP5 pin number. After reboot.cgi?query=onewire http://www.datasheetcatalog.wikipedia. The device is listed under hw. The following was added in /etc/rc.http://www.c".cgi?query=sysctl&amp.owtemp0 hw. which can be downloaded at: .org/wiki/Onewire http://www. the device is found: gpioow0 at gpio1: DATA[21] open-drain pull-up onewire0 at gpioow0 And: owtemp0 at onewire0 "Temperature" sn 000001b3da23 Reading the temperature is very easy now.sensors.

com/tvlooy/weather-station Powered by the Dedicated Servers and Cloud Computing of Rackspace Hosting® Blog About Contact & Support Training Job Board Shop API Status © 2011 GitHub Inc.tvlooy/weather-station . Terms of Service Privacy Security Format Text Headers # This is an <h1> tag ## This is an <h2> tag ###### This is an <h6> tag Text styles *This text will be italic* _This will also be italic_ **This text will be bold** __This will also be bold__ *You **can** combine them* Lists Unordered * Item 1 * Item 2 * Item 2a * Item 2b Ordered 1.GitHub https://github. Item 3 * Item 3a * Item 3b Miscellaneous Images 4 sur 5 27/06/2011 14:59 . All rights reserved. Item 2 3. Item 1 2.

com .com/tvlooy/weather-station ![GitHub Logo](/images/logo.tvlooy/weather-station . indent your code 4 spaces Here is a Python code example without syntax highlighting: def foo: if not bar: return true Inline code for comments I think you should use an `<addr>` element here instead.png) Format: ![Alt Text](url) Links http://github.GitHub https://github.facebox({div:'#foo'}) } } ``` Or.automatic! [GitHub](http://github. Code Examples in Markdown Syntax highlighting with GFM ```javascript function fancyAlert(arg) { if(arg) { $.com) Blockquotes As Kanye West said: > We're living the future so > the present is our past. 5 sur 5 27/06/2011 14:59 .

Sign up to vote on this title
UsefulNot useful