Arduino nano and CJMCU board, 1 side PCB

Using only 1 side PCB, no wires and requiring minimum space.

Quadrature encoder pins go to Arduino Nano’s interrupt pins.

Digital side RST, A07, A04, A03 and A02 are not connected.

CJMCU motor board is the tipical ST VNH2SP30 chinese board (I’ve more posts about it)

I’ve put it vertically.

Nano_PinOut

 

Snort in Debian 8 Jessie

DEbian Jessie doesn’t have a package for Snort so I’ve at least two options, compile from source and take it from testing. I don’t want to have broken packages so I won’t add testing to my sources list directly and I will only use it for specific packages, in this case snort.
It works and nothing is broken.

vim /etc/apt/apt.conf.d/99defaultrelease:


  APT::Default-Release "stable";

vim /etc/apt/sources.list.d/stable.list


  deb     http://ftp.de.debian.org/debian/    stable main contrib non-free
  deb-src http://ftp.de.debian.org/debian/    stable main contrib non-free

  deb     http://security.debian.org/         stable/updates  main contrib non-free

vim /etc/apt/sources.list.d/testing.list


  deb     http://ftp.de.debian.org/debian/    testing main contrib non-free
  deb-src http://ftp.de.debian.org/debian/    testing main contrib non-free

  deb     http://security.debian.org/         testing/updates  main contrib non-free

apt-get update

apt-cache -t testing search snort

  ...
  snort - flexible Network Intrusion Detection System
  snort-common - flexible Network Intrusion Detection System - common files
  snort-common-libraries - flexible Network Intrusion Detection System - libraries
  snort-doc - flexible Network Intrusion Detection System - documentation
  snort-rules-default - flexible Network Intrusion Detection System - ruleset
  ...

apt-get -t testing install snort

Source:
http://serverfault.com/questions/22414/how-can-i-run-debian-stable-but-install-some-packages-from-testing

Now my Ansible code


- hosts: 
    somehost
  gather_facts: yes

  tasks:

  - name: Copy defaultrelease for apt
    copy: 
      src: files/99defaultrelease
      dest: "/etc/apt/apt.conf.d/99defaultrelease"

  - file: dest=/etc/apt/sources.list.d/ state=directory

  - name: Copy stable and testing sources
    copy: 
      src: "files/{{ item }}"
      dest: "/etc/apt/sources.list.d/"
    with_items:
      - stable.list
      - testing.list

  - name: Update apt cache if needed.
    apt: update_cache=yes

  - name: Install Snort
    apt: 
      name={{ item }} 
      state=present 
      default_release=testing
    with_items:
      - snort
      - snort-common
      - snort-rules-default 

nvidia Jetson TK1 board dead

U-Boot SPL 2014.10-rc2-00001-g9f88c9e (Dec 01 2014 – 14:29:15)
[0000.000] [TegraBoot] (version UNDEF_BUILD)
[0000.004] Reset reason: power on reset
[0000.008] Processing in recovery mode
[0000.011] Established communication link with host
[0001.088] Downloaded bct successfully
[0001.093] No Battery Present
[0001.097] Sdram initialization is successful
[0001.111] Downloaded DTB successfully
[0001.138] No Battery Present
[0001.227] Downloaded bootloader successfully
[0001.231] CPU-bootloader entry address: 0x83d88000
[0001.235] BoardId: 375
[0001.238] Vpr Carveout Base=0x0f4600000 Size=0x00ba00000
[0001.243] Tsec Carveout Base=0x0f2600000 Size=0x002000000
[0001.248] Lp0 Carveout Base=0x0f25ff000 Size=0x000001000
[0001.253] Xusb Carveout Base=0x0f2300000 Size=0x000200000
[0001.258] Platform-DebugCarveout: 0
[0001.285] NvTbootI2cClearBus(): error code 0x00045004 Invalid register value in bus clear status register
[0001.294] NvTbootI2cDeviceWrite(): error code 0x00045004 I2c Open Failed
[0001.301] NvTbootI2c: Read failed for slave 0x80, offset 0x00 with error code 0x00045004
[0001.308] FAILURE in NvTbootConfigureCpu
[0001.312] Error is 45004

More info about the error 45004:

0x00045004, “The controller reports the error during transaction like fifo overrun, underrun”)

So basically it needs I2C to boot and it doesn’t work.

https://devtalk.nvidia.com/default/topic/831539/now-unable-to-flash-jetson-tk1/?offset=17

 

 

usb hub review

usbhub


lsusb

Bus 003 Device 030: ID 8564:1000


An unbranded Chinese 10 port usb hub

I plugged a usb stick on each port and used usb-devices to check how they're named.

Each written line is a port from 1 to 10


T: Bus=03 Lev=03 Prnt=09 Port=00 Cnt=01 Dev#= 14 Spd=12 MxCh= 0
T: Bus=03 Lev=03 Prnt=09 Port=01 Cnt=01 Dev#= 13 Spd=12 MxCh= 0

T: Bus=03 Lev=04 Prnt=10 Port=00 Cnt=01 Dev#= 16 Spd=12 MxCh= 0
T: Bus=03 Lev=04 Prnt=10 Port=01 Cnt=01 Dev#= 17 Spd=12 MxCh= 0
T: Bus=03 Lev=04 Prnt=10 Port=02 Cnt=01 Dev#= 18 Spd=12 MxCh= 0
T: Bus=03 Lev=04 Prnt=10 Port=03 Cnt=01 Dev#= 19 Spd=12 MxCh= 0

T: Bus=03 Lev=04 Prnt=11 Port=00 Cnt=01 Dev#= 20 Spd=12 MxCh= 0
T: Bus=03 Lev=04 Prnt=11 Port=01 Cnt=01 Dev#= 21 Spd=12 MxCh= 0
T: Bus=03 Lev=04 Prnt=11 Port=02 Cnt=01 Dev#= 22 Spd=12 MxCh= 0
T: Bus=03 Lev=04 Prnt=11 Port=03 Cnt=01 Dev#= 23 Spd=12 MxCh= 0


It seems it has 3 hubs inside. one for ports one and two and the other two hubs and then another two hubs.

The red leds cannot be turned off without desoldering. The board is made of bakelite and is brittle but does well inside the plastic enclosure.

VNH2SP30 CJMCU single motor Arduino test code

Detrasdelante

Arduino Test Code


   /* 
      EN (Diagnostic) and 
      CS (Current Sense would go to analog in)
      are not connected.
      GND to Arduino nano's GND
      +5V to Arduino nano's VIN
   */

    int PWM  = 3;  
    int InA = 7;
    int InB = 8;
    
    int PWM_val = 64; // 25% = 64; 50% = 127; 75% = 191; 100% = 255

    void setup() {
   
      pinMode(InA, OUTPUT);
      pinMode(InB, OUTPUT);
      pinMode(PWM, OUTPUT);
    }

    void loop() {
      // Turn CW ClockWise  
      digitalWrite(InA, HIGH);
      digitalWrite(InB, LOW);
      analogWrite(PWM, PWM_val);
    
      /*
      // Turn CCW Counter ClockWise
      digitalWrite(InA, LOW);
      digitalWrite(InB, HIGH);
      analogWrite(PWM, PWM_val);
      */
    }

This can work as a unitary test code for those cheap chinese boards. Their price is cheaper than the unitary chip price from ST.

Power consumption on the rover

lsusb -v

Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
MaxPower 100mA

An Arduino Nano also reports 100mA but according to the datasheet it requires less than 20mA in normal use and 50mA is more likely.

10 Arduino <= 60mA*10 = 600mA = 0.6A @5V
2 Usb Hub <= 100mA *2 = 200mA = 0.2A @ 5V
1 Jetson TK1 <= 2-3A @ 12V
total<=40W

All that has to be powered by a Poweradd Apollo Pro

— Output: 1 x USB 5V 2.1A + 1 x DC12V/16V/19V 3A
— Solar Charger: 15V 150mA (max)
— Size: 224.79 x 124.96 x 21.84 mm
— Weight: 489 g

http://www.ipoweradd.com/poweradd-apollo-pro-23000mah-solar-battery-charger-for-iphone-5s-5c-5-4s-4-6_p1263.html

I will tear apart the powerbank to see what is inside before choosing it.

Some people said it had 18650 cells inside.

The 18 represents the cell’s diameter, in millimeters.
The 65 represents the cell’s length
The 0 represents that the cell is round

its thickness is 21.84 mm so it might be possible.

Problems:

The rover is supposed to carry a Kinect v1 and this one requires 12W @ 12V/1A

http://wiki.ros.org/kinect/Tutorials/Adding%20a%20Kinect%20to%20an%20iRobot%20Create