Plugwise Smile P1 – Verbinden via UART TTL
Dit voorbeeld laat zien hoe je de Plugwise Smile P1 kan aansluiten om in het Linux systeem te komen doormiddel van de UART connectie.
Wat heb je nodig?
1) UART > USB stick.
2) PuTTy telnet software.
Volgens de handleiding van Omnima MiniEMBWiFi is dit de UART pinout op de Smile (JP2):
Smile P1 pin: | Functie: |
---|---|
01 | +3.3v |
02 | RxD |
03 | GND |
04 | TxD |
De verbinding tussen de Smile en Stick is dus als volgt:
Smile P1 pin: | UART stick pin: |
---|---|
01 (+3.3v) | +3.3v |
02 (RxD) | TxD |
03 (GND) | GND |
04 (TxD) | RxD |
Ps. bij een seriele verbinding moet je altijd TX met RX verbinden en andersom.
LET OP: Wanneer je een adapter gebruikt om spanning op de Smile te zetten haal de MIN uit de UART of je blaast je UART stick op!
De Plugwise Smile P1 aangesloten op de UART Stick:
COM interface / console:
Na het installeren van de UART stick drivers in Windows heb je een COM “interface / console” nodig, je kan PuTTY gebruiken maar ik heb zelf de “Seriele monitor” van de Arduino software gebruikt!
Tip: Kijk van te voren even in Windows apparaatbeheer welke COM poort is toegewezen voor je UART Stick!
Failsave mode:
In de Openwrt software dat draait op de smile zit een “Failsave” modus, deze modus is te vergelijken met de veilige modus van Windows, je kan wat diagnostische programma’s draaien etc…
1) Open de COM console, zet de COM poort goed en zet de datarate op 9600 baud!
2) Steek nu de UART stick in de USB poort, je ziet de leds op de Smile oplichten!
(zo niet?, dan werkt de +3.3V op jou stick ook niet, zorg voor een andere voedingsbron.)
Op je COM console zie je eerst een boel rare ASCII karakters verschijnen, dit stuk van de “bootloader” op de smile is @57600 Baud, wacht even en er verschijnt leesbare informatie in je console.
Bootloader @57600 baud:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
U-Boot 1.1.3 (Jul 9 2009 - 12:57:03) Board: Ralink APSoC DRAM: 32 MB relocate_code Pointer at: 81fac000 flash_protect ON: from 0xBF000000 to 0xBF01FF7F protect on 0 protect on 1 protect on 2 protect on 3 protect on 4 protect on 5 protect on 6 protect on 7 protect on 8 flash_protect ON: from 0xBF030000 to 0xBF03FFFF protect on 10 *** Warning - bad CRC, using default environment ============================================ Ralink UBoot Version: 3.2 -------------------------------------------- ASIC 3052_MP2 (Port5<->None) DRAM COMPONENT: 256Mbits DRAM BUS: 16BIT Total memory: 32 MBytes Date:Jul 9 2009 Time:12:57:03 ============================================ icache: sets:128, ways:4, linesz:32 ,total:16384 dcache: sets:128, ways:4, linesz:32 ,total:16384 ##### The CPU freq = 320 MHZ #### SDRAM bus set to 16 bit SDRAM size =32 Mbytes Please choose the operation: 1: Load system code to SDRAM via TFTP. 2: Load system code then write to Flash via TFTP. 3: Boot system code via Flash (default). 4: Entr boot command line interface. 9: Load Boot Loader code then write to Flash via TFTP. You choosed 3 0 3: System Boot system code via Flash. ## Booting image at bf050000 ... Image Name: MIPS OpenWrt Linux-3.2.12 Created: 2013-10-10 12:15:14 UTC System Control Status = 0x00400000 Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 821564 Bytes = 802.3 kB Load Address: 80000000 Entry Point: 80000000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK No initrd ## Transferring control to Linux (at address 80000000) ... ## Giving linux memsize in MB, 32 Starting kernel ... [ 0.000000] Linux version 3.2.12 (theo@tvrU10) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #5 Thu Oct 10 14:15:04 CEST 2013 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU revision is: 0001964c (MIPS 24KEc) [ 0.000000] Ralink RT3350 id:1 rev:2 running at 320.00 MHz [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 02000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Zone PFN ranges: [ 0.000000] Normal 0x00000000 -> 0x00002000 [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[1] active PFN ranges [ 0.000000] 0: 0x00000000 -> 0x00002000 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 [ 0.000000] Kernel command line: board=OMNI-EMB console=ttyS1,9600 mtdparts=physmap-flash.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory),896k(kernel),6976k(rootfs),7872k@0x50000(firmware) console=ttyS1,57600 rootfstype=squashfs,jffs2 [ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes) [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) [ 0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes [ 0.000000] Writing ErrCtl register=0007826e [ 0.000000] Readback ErrCtl register=0007826e [ 0.000000] Memory: 29988k/32768k available (1883k kernel code, 2780k reserved, 313k data, 164k init, 0k highmem) [ 0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS:48 |
Smile boot @9600 baud:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
[ 0.000000] console [ttyS1] enabled, bootconsole disabled [ 0.010000] Calibrating delay loop... 212.58 BogoMIPS (lpj=1062912) [ 0.100000] pid_max: default: 32768 minimum: 301 [ 0.110000] Mount-cache hash table entries: 512 [ 0.120000] NET: Registered protocol family 16 [ 0.130000] MIPS: machine is Omnima MiniEMBWiFi [ 0.160000] bio: create slab <bio-0> at 0 [ 0.170000] Switching to clocksource MIPS [ 0.190000] NET: Registered protocol family 2 [ 0.240000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.320000] TCP established hash table entries: 1024 (order: 1, 8192 bytes) [ 0.410000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.480000] TCP: Hash tables configured (established 1024 bind 1024) [ 0.560000] TCP reno registered [ 0.600000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.670000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.740000] NET: Registered protocol family 1 [ 0.850000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.920000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 1.050000] msgmni has been set to 58 [ 1.090000] io scheduler noop registered [ 1.140000] io scheduler deadline registered (default) [ 1.200000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled [ 1.280000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A [ 1.360000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A [ 1.440000] physmap platform flash device: 00800000 at bf000000 [ 1.520000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022cb [ 1.640000] Amd/Fujitsu Extended Query Table at 0x0040 [ 1.700000] Amd/Fujitsu Extended Query version 1.1. [ 1.760000] number of CFI chips: 1 [ 1.800000] 6 cmdlinepart partitions found on MTD device physmap-flash.0 [ 1.880000] Creating 6 MTD partitions on "physmap-flash.0": [ 1.950000] 0x000000000000-0x000000030000 : "u-boot" [ 2.020000] 0x000000030000-0x000000040000 : "u-boot-env" [ 2.090000] 0x000000040000-0x000000050000 : "factory" [ 2.150000] 0x000000050000-0x000000130000 : "kernel" [ 2.220000] 0x000000130000-0x000000800000 : "rootfs" [ 2.280000] mtd: partition "rootfs" set to be root filesystem [ 2.350000] mtd: partition "rootfs_data" created automatically, ofs=550000, len=2B0000 [ 2.450000] 0x000000550000-0x000000800000 : "rootfs_data" [ 2.520000] 0x000000050000-0x000000800000 : "firmware" [ 2.600000] TCP westwood registered [ 2.640000] NET: Registered protocol family 17 [ 2.690000] 8021q: 802.1Q VLAN Support v1.8 [ 2.750000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4. [ 2.840000] Freeing unused kernel memory: 164k freed [ 5.750000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0 [ 5.960000] Button Hotplug driver version 0.4.1 - preinit - - regular preinit - [ 6.500000] JFFS2 notice: (334) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 10 of xref (0 dead, 0 orphan) found. [ 7.640000] SCSI subsystem initialized [ 7.890000] usbcore: registered new interface driver usbfs [ 7.950000] usbcore: registered new interface driver hub [ 8.020000] usbcore: registered new device driver usb [ 8.250000] dwc_otg: version 2.72a 24-JUN-2008 [ 8.300000] dwc_otg: Core Release: 2.66a [ 8.560000] dwc_otg: Periodic Transfer Interrupt Enhancement - disabled [ 8.640000] dwc_otg: Multiprocessor Interrupt Enhancement - disabled [ 8.710000] dwc_otg: Using DMA mode [ 8.760000] dwc_otg: Device using Buffer DMA mode [ 8.810000] dwc_otg dwc_otg.0: DWC OTG Controller [ 8.870000] dwc_otg dwc_otg.0: new USB bus registered, assigned bus number 1 [ 8.960000] dwc_otg dwc_otg.0: irq 26, io mem 0x101c0000 [ 9.020000] dwc_otg: Init: Port Power? op_state=1 [ 9.080000] dwc_otg: Init: Power Port (0) [ 9.130000] hub 1-0:1.0: USB hub found [ 9.170000] hub 1-0:1.0: 1 port detected [ 9.250000] Initializing USB Mass Storage driver... [ 9.310000] usbcore: registered new interface driver usb-storage [ 9.380000] USB Mass Storage support registered. switching to jffs2 - init - [ 32.270000] Compat-wireless backport release: compat-wireless-2012-02-27-1-r31145 [ 32.360000] Backport based on wireless-testing.git master-2012-02-27 [ 32.640000] cfg80211: Calling CRDA to update world regulatory domain [ 33.400000] cfg80211: World regulatory domain updated: [ 33.460000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) [ 33.560000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 33.650000] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) [ 33.750000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) [ 33.840000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 33.930000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 35.760000] PPP generic driver version 2.4.2 [ 35.930000] ip_tables: (C) 2000-2006 Netfilter Core Team [ 36.260000] NET: Registered protocol family 24 [ 36.410000] nf_conntrack version 0.5.0 (471 buckets, 1884 max) [ 37.040000] usbcore: registered new interface driver usbserial [ 37.110000] USB Serial support registered for generic [ 37.170000] usbcore: registered new interface driver usbserial_generic [ 37.250000] usbserial: USB Serial Driver core [ 37.530000] USB Serial support registered for FTDI USB Serial Device [ 37.610000] usbcore: registered new interface driver ftdi_sio [ 37.670000] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver [ 37.770000] USB Serial support registered for pl2303 [ 37.830000] usbcore: registered new interface driver pl2303 [ 37.900000] pl2303: Prolific PL2303 USB to serial adaptor driver [ 54.890000] ramips-wdt: timeout value 60 must be 0 < timeout < 40 [ 69.250000] ifplugd: eth0, up: prev=down, cur=up [ 87.430000] *** smile_abcdef: Booting finished at 2014-03-29T22:12:55+0000 |
Wanneer je deze regel ziet (firmware v1.1.9):
1 |
Press the [f] key and hit [enter] to enter failsafe mode |
Druk dan snel op F en “enter” via je console, nu start de smile op in “failsave” mode met een Linux Bash command:
1 2 3 4 5 6 7 8 9 10 |
Press the [f] key and hit [enter] to enter failsafe mode f - failsafe - BusyBox v1.19.3 (2012-07-19 12:00:46 CEST) built-in shell (ash) Enter 'help' for a list of built-in commands. ------------------------------------- Plugwise Smile 1.1 Based on OpenWRT ------------------------------------- root@(none):/# |
Let op FAILSAVE mode is eruit gehaald in recentere versies hoger dan 1.1.9 van de Smile!