2016年6月6日 星期一

deviation build env



第一步先安裝  windows docker

   https://docs.docker.com/engine/installation/windows/

must have a 64-bit operating system running Windows 7 or higher

Make sure your CPU supports virtualization technology and virtualization support is enabled in BIOS and recognized by Windows.  vt-D or AMD-D

For Windows 7

Run the Microsoft® Hardware-Assisted Virtualization Detection Tool and follow the on-screen instructions.  

Installation

If you have VirtualBox running, you must shut it down before running the installer.
  1. Go to the Docker Toolbox page.
  2. Click the installer link to download.
    • installs executables for the Docker tools inC:\Program Files\Docker Toolbox
    • install VirtualBox; or updates any existing installation
    • adds a Docker Inc. folder to your program shortcuts
    • updates your PATH environment variable
For Windows users, you should run the 'Docker Quickstart Terminal'. All of the following commands will be run inside that window.
First, you need to download the Deviation build environment. From the shell, run:
docker pull deviationtx/deviation-docker

If you are a developer and have already checked out the Deviation GIT source, you can use:
docker create -it -v ~/devo_builds:/release -v <path to git>:/git --name deviation_build deviationtx/deviation-docker
NOTE: the <path to git> should be the directory above where Deviation is checked out. E.g. if Deviation is checked out to ~/git/deviation, <path to git> would be '~/git'

Building Deviation

You can now start the Docker container, and start building Deviation.
To get started run: docker start -i deviation_build

Building the Deviation Manual

The docker image is also capable of building the deviation manual. After creating the Docker container, start docekr and enter the Shell. run:sudo /root/build.py –manual-prereq to install the necessary build environment
  

(右上角的SHELL 按下去)

Next (still from the docker shell), run:cd /git; git clone https://github.com/DeviationTX/deviation-manual

For instance, from within the docker shell and run:cd deviation-manual; make TARGET=devo10 html pdf



ref : http://www.deviationtx.com/wiki/development/docker

2016年6月3日 星期五

navio2 + miniosd



UART radio
For UART port use /dev/ttyAMA0 serial. uartradio
pinout : 
5V     ->  紅色
TX    ->   白色
RX    ->  藍色
IO18   ->   綠色
IO17   ->  黃色
GND    -> 黑色
  TX  <->   RX
 RX    <->   TX   
   5V   <->   5V
   GND  <->  GND
Vin  ->  Video input ... 接鏡頭的NTSC signal
VOUT  ->  Video output  ->  接到  發射器...
12V  ->  吃電池的12V
預設switch 都是  off   .   FR4  ... CH8




USB radio
Use /dev/ttyUSB0 virtual serial port for USB. usbradio

nFR24L01 研究



ref  http://playground.arduino.cc/InterfacingWithHardware/Nrf24L01

Ref : https://github.com/aaronds/arduino-nrf24l01/tree/master/Mirf



example 1:  check register

/**
* Pins:
* Hardware SPI:
* MISO -> 12
* MOSI -> 11
* SCK -> 13
*
* Configurable:
* CE -> 8
* CSN -> 7
*/
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
void setup() {
Serial.begin(9600);
Serial.println( "Starting wireless..." );
// Setup
Mirf.spi = &MirfHardwareSpi;
Mirf.init();
Mirf.setRADDR((byte *)"clie1");
Mirf.payload = sizeof(unsigned long);
Mirf.config();
// Read and print RF_SETUP
byte rf_setup = 0;
Mirf.readRegister( RF_SETUP, &rf_setup, sizeof(rf_setup) );
Serial.print( "rf_setup = " );
Serial.println( rf_setup, BIN );
Serial.println( "Wireless initialized!" );
}
void loop() {}


example 2:   tx example

/**
* A Mirf example to test the latency between two Ardunio.
*
* Pins:
* Hardware SPI:
* MISO -> 12
* MOSI -> 11
* SCK -> 13
*
* Configurable:
* CE -> 8
* CSN -> 7
*
* Note: To see best case latency comment out all Serial.println
* statements not displaying the result and load
* 'ping_server_interupt' on the server.
*/
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
void setup(){
Serial.begin(9600);
/*
* Setup pins / SPI.
*/
/* To change CE / CSN Pins:
*
* Mirf.csnPin = 9;
* Mirf.cePin = 7;
*/
/*
Mirf.cePin = 7;
Mirf.csnPin = 8;
*/
Mirf.spi = &MirfHardwareSpi;
Mirf.init();
/*
* Configure reciving address.
*/
Mirf.setRADDR((byte *)"clie1");
/*
* Set the payload length to sizeof(unsigned long) the
* return type of millis().
*
* NB: payload on client and server must be the same.
*/
Mirf.payload = sizeof(unsigned long);
/*
* Write channel and payload config then power up reciver.
*/
/*
* To change channel:
*
* Mirf.channel = 10;
*
* NB: Make sure channel is legal in your area.
*/
Mirf.config();
Serial.println("Beginning ... ");
}
void loop(){
unsigned long time = millis();
Mirf.setTADDR((byte *)"serv1");
Mirf.send((byte *)&time);
while(Mirf.isSending()){
}
Serial.println("Finished sending");
delay(10);
while(!Mirf.dataReady()){
//Serial.println("Waiting");
if ( ( millis() - time ) > 1000 ) {
Serial.println("Timeout on response from server!");
return;
}
}
Mirf.getData((byte *) &time);
Serial.print("Ping: ");
Serial.println((millis() - time));
delay(1000);
}

       another arduino  run

/**
* An Mirf example which copies back the data it recives.
* While wating the arduino goes to sleep and will be woken up
* by the interupt pin of the mirf.
*
* Warning: Due to the sleep mode the Serial output donsn't work.
*
* Pins:
* Hardware SPI:
* MISO -> 12
* MOSI -> 11
* SCK -> 13
*
* Configurable:
* CE -> 8
* CSN -> 7
*/
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
#include <avr/sleep.h>
void wakeupFunction(){
}
void toSleep(){
attachInterrupt(0,wakeupFunction,LOW);
sleep_mode();
detachInterrupt(0);
}
void setup(){
Serial.begin(9600);
/*
* Set the SPI Driver.
*/
Mirf.spi = &MirfHardwareSpi;
/*
* Setup pins / SPI.
*/
Mirf.init();
/*
* Configure reciving address.
*/
Mirf.setRADDR((byte *)"serv1");
/*
* Set the payload length to sizeof(unsigned long) the
* return type of millis().
*
* NB: payload on client and server must be the same.
*/
Mirf.payload = sizeof(unsigned long);
/*
* Write channel and payload config then power up reciver.
*/
Mirf.config();
/*
* Configure seep mode to save power.
*/
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
Serial.println("Listening...");
}
void loop(){
/*
* A buffer to store the data.
*/
byte data[Mirf.payload];
/*
* If a packet has been recived.
*/
if(!Mirf.isSending() && Mirf.dataReady()){
/*
* Get load the packet into the buffer.
*/
Mirf.getData(data);
/*
* Set the send address.
*/
Mirf.setTADDR((byte *)"clie1");
/*
* Send the data back to the client.
*/
Mirf.send(data);
}else{
/* No data - night night. */
toSleep();
}
}






Vi  -> 5V  
VDD ->  3.6V



datasheet

Ref : https://www.sparkfun.com/datasheets/Components/SMD/nRF24L01Pluss_Preliminary_Product_Specification_v1_0.pdf