Openwrt Serial Port Programming Pdf

11 comments
Openwrt Serial Port Programming Pdf Rating: 4,0/5 5643votes

Raspberry Pi reading WH1. RFM0. 1 and RFM1. This article describes using an RFM0. RFM1. 2b FSK RF transceiver with a Raspberry Pi to receive sensor data from a Fine Offset WH1. WH1. 08. 1 specifically a Maplin N9. GY weather stations RF transmitter. I originally used the RFM1. I had one to hand, but later found that the RFM0. RFM0. 1 in OOK mode is noticeably better. Theyre pin compatible, but the SPI registers differ between the modules, in terms of both register address and function. This project is changing to be microcontroller based, and using an AM receiver module Aurel RX 4. MM5 a much more effective approach arduino yun reading wh. Currently testing on Arduino Yun, but will probably move to a more platform agnostic design to support Dragino and Carambola etc. The weather station comprises an LCD display and a mast of sensors. The LCD display also incorporates temperature and humidity sensors for indoor readings, as well as a barometric pressure sensor. The mast contains sensors for temperature, humidity, wind speed, wind direction, and rainfall, and transmits data packets using a 4. MHz transmitter. Its the data from the mast that this project is focused on, along with the addition of a Bosch BMP0. I2. C module to get barometric pressure. There are variants of the Fine Offset WH1. For anyone who already has a rough idea of whats required, and just wants a quick overview for some pointers, Ive presented a summary first below. Wiring the Module. Note the revision 2 boards affect this project in two ways. First, if youre using the BMP0. I2. C 1 rather than I2c 0. Changing the base address of the I2. C peripheral in the code should be all thats required. Second, the GPIO pin on header P1 1. Search the worlds information, including webpages, images, videos and more. Google has many special features to help you find exactly what youre looking for. Bitcoin. La bolla dei bitcoin ed il sonno dei regulatorsBitcoin da 10 a 11mila dollari in poche ore. Poi cala a 9500. bolla 3D Printer. Musthave Anet A6 3D Printer Mega Bundle at a Great Price EDITION 62017. DIY Kitchen Scale, RPi Internet Radio, Weather Display and lots more The internet hosts lots and lots of online radiostreams, most of them with a certain theme, ranging from old time classics to Tibetian riverdancing. I. Openwrt Serial Port Programming PdfGPIO2. GPIO2. Again, the code will need simple modifications. Ill incorporate these into the code in future, but until then youll have to figure out where the changes go if you want to build this on Rev 2. Email me if you need help. Pin connections from the RFM0. Image/2010/01/27/8.gif' alt='Openwrt Serial Port Programming Pdf' title='Openwrt Serial Port Programming Pdf' />Home automation and home control HA Software source code and links mostly for the home automation devices like Insteon PowerLinc V2, CM11A, CM17 Firecracker. RFM1. 2B to the Raspberry Pi are as follows. You may choose to add current limiting resistors. Pull ups may be required for SDO and SDI Ive never found a definitive specification for SPI it works with them, and it probably works without them too SDO MISO PU resistor. SDI MOSI PU resistor. SEL CE0N. The opensource Arduino Software IDE makes it easy to write code and upload it to the board. Lyon Text Font more. It runs on Windows, Mac OS X, and Linux. The environment is written in. This article describes using an RFM01 or RFM12b FSK RF transceiver with a Raspberry Pi to receive sensor data from a Fine Offset WH1080 or WH1081 specifically a. FSKDATAn. FFS GPIO2. P1 1. 3. ANT 1. VDD 3. V3 from Pi. GND GND on Pi. Optionally, you may want to drive n. RES from a GPIO output. I used n. RES GPIO2. I finish experimenting. EmeraldCOMportsettings.jpg' alt='Openwrt Serial Port Programming Pdf' title='Openwrt Serial Port Programming Pdf' />I used a breadboard to wire this up, and unsurprisingly found this to be far from ideal with the RFM1. At close range, the receiver works very reliably, but as the signal weakens, noise often drowns it out even just leaning close to the circuit, or moving a component. A breadboard is fine to test the SPI stuff, and also works well when the transmitter is in close range, but to test the receiver properly, etching a PCB or even just wiring the bits together would be a better idea. Wired in the noisy breadboard. I decided to wire the RFM1. Pi was generating enough of noise of its own, and having the module more accurately, the antenna so close to the Pi was affecting reception. Openwrt Serial Port Programming Pdf' title='Openwrt Serial Port Programming Pdf' />A long ribbon cable improved things, as did a length of coax to move the antenna away from the rest of the electronics. When I switched in the RFM0. RFM1. 2b, the situation seemed much better, and the device worked more reliably than the RFM1. How it looks before adding the BMP0. The RFM0. 1 seems far more immune to noise its wired to a 2. Pi. The antenna is simply a 14 wavelength 1. It receives perfectly even in this harsh environment, possibly in part because it works on the lowest LNA Low Noise Amplifier settings. Any wires near the Pi are capable of generating RF noise, even just a breadboard jumper wire sitting underneath the Pi, or an unshielded Ethernet cable. Be aware of this and keep noise sources out of the way while testing or wire the antenna on a length of 5. Just connect SDA and SCL along with 3. V3 and GND for the BMP0. Received Data. The transmitter sends 1. Some of these differ from any of the documentation Ive found on Fine Offset weather stations, so Ive described them here letters to the nibbles for the description below Byte 0 1 2 3 4 5 6 7 8 9. Nibble ab cd ef gh ij kl mn op qr st. Example a. 1 8. 2 0e 5d 0. Ive interpreted the nibbles as follows abc device identifierdef temperaturegh humidityij average wind speed low bytekl gust wind speed low bytem unknownn rainfall counter high nibbleop rainfall counterq battery low indicatorr wind directionst checksum. The nibble q is likely to be the low battery indicator, thanks to Ken Mc. Cullagh reporting that his transmitter is now sending a 1 rather than a 0, and his LCD display is also now showing a low battery symbol. Nibble m is unknown. It may be that the rainfall counter is two whole bytes time will tell I may take a watering can to the rain collector, or perhaps its the high nibble of either the wind speed or gust speed. Between them, nibbles m and q could provide this extra wind data. To get temperature, subtract 4. For example, reading 0x. This represents 1. C. To get a wind speed values in ms, multiply the value by 0. So, value 0x. 04 is round4 0. For rainfall, as documented elsewhere, multiply by 0. This value is a counter that increments to zero after 0xff or 0xfff if it turns out that nibble q is part of the counter. Humidity is simply displayed as a decimal, and wind direction ranges from 0 to 1. N, NNE, NE, ENE, E, etc., as per the LCD display. The checksum is CRC8, and a nicely written function, adapted from the One. Wire Arduino Library by Luc Small, is included in the source code to calculate this checksum. The Code. You can download the source code from here. Unpack the tarball on the Pi, cd into the created directory, and run make. This should generate the wh. If youre using a cross compiler, the you may need to edit the CC variable in Makefile to point to your compiler. If youre using an RFM1. RFM0. 1 to define RFM1. B. The program configures the RFM0. SPI, and then continuously looks for interesting data from the module on the Pis GPIO pin, and dumping valid packets to stdout as hex strings. It also decodes the hex data into more meaningful values, and sends them to stdout as printf formatted strings. Note that the calculations on the Raspberry Pi are done using floating point arithmetic, whereas the WH1. This means that the output may differ slightly between the Pi and the LCD display, because the Pis calculations are more accurate. For example, raw wind speed of 0x. Pi, but only 0. 3ms on the WH1. Converting this to mph yields 0. Pi, and 0. 7 mph on the WH1. Therefore the Raspberry Pi reading is more accurate. You may notice that the output below also displays barometric pressure and an indoor temperature value. These have come from a Bosch BST BMP0. Barometric Pressure Sensor via I2. C. Wiring the module to the Pi was trivial, since it has the pull up resistors and bypass capacitors already on board. Therefore, simply wiring SDA and SCL, along with 3. V3 and GND, to the Pi is enough to get this sensor working. If you dont plan to use one of these, remove the line define USEBMP0. Only SDASCL and 3. V3GND, The other two neednt be connected. The output from the software includes a scan of RSSI duty on all amplification levels, RSSI thresholds, and baseband bandwidths.