Difference between revisions of "DreamCatcher"

From RadioNerds
Jump to navigation Jump to search
Line 1,620: Line 1,620:
 
FM broadcasts tend to be quite powerful signals, and I have not needed an antenna for receiving any of the local stations, but in case of bad reception, just adding a sub-1M SMA cable at the LNA_BYPASS RF input of the Dreamcatcher should improve reception dramatically.
 
FM broadcasts tend to be quite powerful signals, and I have not needed an antenna for receiving any of the local stations, but in case of bad reception, just adding a sub-1M SMA cable at the LNA_BYPASS RF input of the Dreamcatcher should improve reception dramatically.
 
</div>
 
</div>
 +
 +
==Modify the Tuner application to add Frequencies==
 +
Although this isnt all that useful unless you want to have lots of entries in the satellite list that won't work, it is important to know how all this works so you can if you need to later...
 +
 +
Skylark is read only, so to make these changes, you will need to use the User.sh service scripts to re-install the changes after every reboot, then restart the ui service.
 +
 +
Create a Custom skylark_config.json file
 +
Modify your custom skylark_config.json file and copy to the proper locations (if you dont have this file, copy /etc/skylark_config.json to this location
 +
 +
Add the new entries to the "tunerConf" section
 +
Add new entires for each new satellite entry, note the entries for sat1, sat2, sat3 below:
 +
 +
"tunerConf": {
 +
                "beams": {
 +
                        "sat1": {                                                                   
 +
                                "label": "Satellite 1",                                           
 +
                                "value": "sat1",                                                   
 +
                                "freq": "1545.1111",                                               
 +
                                "symbolrate": "4200"                                               
 +
                        }, 
 +
                        "sat2": {                                                                   
 +
                                "label": "Satellite 2",                                           
 +
                                "value": "sat2",                                                   
 +
                                "freq": "1545.2222",                                               
 +
                                "symbolrate": "4200"                                               
 +
                        }, 
 +
                        "sat3": {                                                                   
 +
                                "label": "Satellite 3",                                           
 +
                                "value": "sat3",                                                   
 +
                                "freq": "1545.3333",                                               
 +
                                "symbolrate": "4200"                                               
 +
                        }, 
 +
                        "apac": {
 +
                                "label": "Asia Pacific (144E)",
 +
                                "value": "apac",
 +
                                "freq": "1545.9525",
 +
                                "symbolrate": "4200"
 +
                        },
 +
                        "emea": {
 +
                                "label": "Europe, West Asia, Africa (25E)",
 +
                                "value": "emea",
 +
                                "freq": "1545.94",
 +
                                "symbolrate": "4200"
 +
                        },
 +
                        "americas": {
 +
                                "label": "Americas (98W)",
 +
                                "value": "americas",
 +
                                "freq": "1539.8725",
 +
                                "symbolrate": "4200"
 +
                        },
 +
                        "custom": {
 +
                                "label": "Custom",
 +
                                "value": "custom",
 +
                                "freq": "1546.25",
 +
                                "symbolrate": "4200"
 +
                        }
 +
                },
 +
                "selectedBeam": "americas"
 +
        },
 +
Add the new entries to the "overRide" section.
 +
This will allow the new entries to remain after a reboot.
 +
 +
"overRides": [
 +
                "netConf.hostname",
 +
                "netConf.mode",
 +
                "netConf.sta",
 +
                "netConf.ap",
 +
                "tunerConf.selectedBeam",
 +
                "tunerConf.beams.custom",
 +
                "tunerConf.beams.sat1",
 +
                "tunerConf.beams.sat2",
 +
                "tunerConf.beams.sat3"
 +
        ]
 +
save the new skylark_config.json file to /mnt/conf/bin
 +
check the file syntax with "jq -c < skylark_config.json"
 +
 +
Add a user.sh script to /mnt/config/bin directory
 +
NOTE: in order to get this to work reliably i needed to copy the config to both places. im sure in my reverse engineering that i missed something simple, but this worked..
 +
 +
#!/bin/sh
 +
#copy the skylark config to /mnt/conf/etc
 +
cp /mnt/conf/bin/skylark_config.json /mnt/conf/etc/skylark_config.json
 +
 +
#copy the skylark config to /etc
 +
cp -f /mnt/conf/bin/skylark_config.json /etc
 +
 +
#restart the ui service
 +
/etc/init.d/S70ui2service restart
 +
reboot your DC to see how it works...
 +
 +
 +
==Install a custom applicaiton to skylark 4.4==
 +
I've wanted to add some custom applications to the DC running SkyLark (currently 4.4).. this is the process to install it so it remains after a reboot.. Although Skylark is based on the OS.js platform (https://www.os-js.org/), its customized quite a bit.
 +
 +
Additionally Skylark is read only, any changes you make will be overwritten on the next reboot. To get around this, we will use the user script service to re-install the customizations after every reboot, then bounce the window manager.
 +
 +
Create your custom application
 +
you can use an existing application as a template, but you will need to modify much of it so its unique. Developing the application is beyond the scope of this post, and requires more effort. (mine clearly needs some work, but wanted to document this first)
 +
 +
Existing applications can be found in: /usr/share/www/packages/default
 +
copy one of these to your writable location.. in my case it was /mnt/conf/bin
 +
modify the application as required.
 +
 +
Create Custom Icons
 +
you will need both 16x16 and 32x32 size icons
 +
store these in your writable location for example /mnt/conf/bin
 +
 +
Create a custom packages.json
 +
Copy the packages.json file from /usr/lib/node_modules/ui2 to your writable location.. /mnt/conf/bin
 +
 +
modify the file adding an entry to the "www" group for your new application... Check the syntax of the file with "jq -c < packages.json" when your complete.
 +
 +
for my example i added the following..
 +
 +
"default/RACHEL": {                                                     
 +
            "className": "ApplicationRachel",               
 +
            "name": "RACHEL",                                                   
 +
            "mime": null,                                                 
 +
            "icon": "apps/RACHEL.png",                                         
 +
            "category": "utilities",                               
 +
            "preload": [                                                   
 +
                {                                                           
 +
                    "type": "javascript",                                         
 +
                    "src": "combined.js"                                   
 +
                },                                                                 
 +
                {                                           
 +
                    "src": "scheme.html",                                   
 +
                    "type": "scheme"                                       
 +
                },                                                         
 +
                {                                                             
 +
                    "type": "stylesheet",                                   
 +
                    "src": "combined.css"                                   
 +
                }                                                 
 +
            ],                                                             
 +
            "type": "application",                                         
 +
            "path": "default/RACHEL",                                   
 +
            "build": {},                                                   
 +
            "repo": "default"     
 +
        }
 +
Add a User Service Script
 +
Create a "user.sh" script to place all the files in the proper place then restart the ui service..
 +
 +
#!/bin/sh
 +
 +
cp -f /mnt/conf/bin/packages.json /usr/lib/node_modules/ui2
 +
chmod 644 /usr/lib/node_modules/ui2/packages.json
 +
 +
cp -R /mnt/conf/bin/RACHEL /usr/share/www/packages/default
 +
chmod 755 /mnt/conf/bin/RACHEL
 +
 +
cp -f /mnt/conf/bin/RACHEL_16x16.png /usr/share/www/themes/icons/default/16x16/apps/RACHEL.png
 +
 +
cp -f /mnt/conf/bin/RACHEL_32x32.png /usr/share/www/themes/icons/default/32x32/apps/RACHEL.png
 +
 +
/etc/init.d/S70ui2service restart
 +
when you goto the Skylark Web UI, you will see your new application..

Revision as of 22:26, 17 October 2017

Contents

Specs (Version 2.03)

  • L-band SAW filter (1525 - 1559 MHz)
  • Two-stage L-band LNA with 34dB gain
  • 1 PPM TCXO
  • RF bypass for tuning from 24 - 1600 MHz - use as a regular RTL SDR!
  • Software switchable bias tee
  • 3 USB ports
  • GPIO forest
  • UARTs, I2C, SPI headers (unpopulated) for driving external hardware
  • Two microSD card holders - for boot and storage!
  • 1 GHz CPU
  • 512 MB RAM
  • USB wifi dongle (based on RTL8188CUS chipset) - AP mode capable!
  • Lots of LEDs!
  • Switches!
  • microUSB OTG
  • microUSB power port
  • Audio In/Out
  • Kernel Version 4.10 and Uboot (2017.01) support


Setting up the OS

There are two OSs that you can use on the DreamCatcher.

Armbian
Standard ARM Linux OS based on Debian, Highly supported but does NOT have build in support for Outernet. This OS requires lots of tweaking to get up and going...
Compress_plain_32x32.png Armbian for DreamCatcher, V5.27

NOTE: The kernel in this version of Armbian cannot be updated with apt, there is an issue with the Device Trees that will brick the device. Before doing an apt upgrade, set a hold on the kernel packages like this:

sudo apt-mark hold linux-dtb-next-sunxi linux-headers-next-sunxi linux-image-next-sunxi linux-firmware-image-next-sunxi 


Skylark
Os based on Busybox is read only and has the full Outernet system ready to go. This is the one to use if you want to play with outernet with no tweaking

Version 4.4

Compress_plain_32x32.png Skylark, for the Passive Antenna, Released May 14, 2017
Compress_plain_32x32.png Skylark, for the Active Antenna, Released June 22, 2017


Version 4.x

Compress_plain_32x32.png Skylark, for both Antenna Types, Released October 10, 2017


Burning the image to an SD Card

A microSD greater than 4GB in size is required.

Extract the image

It is compressed using "gzip.", many common Unzipping tools on your chosen OS can un-compress these.

Linux / OSx
gunzip [filename.gz]
Windows
use 7Zip


Write the image to the SD card

the best way to burn the SD card is by using etcher here---> https://etcher.io/


Startup the DreamCatcher with Armbian Distro

1) Insert SD card into Dreamcatcher board slot marked "SD0_OS," next to LED array.

2) insert the USB Wifi Dongle, or other USB network device if you have it.

3) Optionally - connect the USB Cable to your PC with a terminal application open.

4) connect power to a USB port, or alternatively the USB cable to PC can provide power

after the bootup process you should see a "Dreamcatcher Login:" prompt

Default Username
root
Default Password
1234


Configure Wifi

To connect to a wifi network, you can use one of the following methods, SSID/password will be stored and applied automatically at next boot.


Single Command Line

nmcli d wifi connect [your_ssid] password [your_password]

nmcli d wifi connect MYSSID password IMSOSECURE

if you succeed, you should see something like:

Connection with UUID '8f820c8a-5af3-4336-8161-6f57030a7ec5' created and activated on device 'wlan1'


Simple Command line Gui

nmtui


The UI is very self explanatory.


Check the current IP

to check assigned ip use:

ifconfig

root@dreamcatcher:/etc# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1104 (1.0 KiB)  TX bytes:1104 (1.0 KiB)

wlan1     Link encap:Ethernet  HWaddr e8:4e:06:4b:a6:fa  
          inet addr:10.0.1.150  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ea4e:6ff:fe4b:a6fa/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:78 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:14882 (14.5 KiB)  TX bytes:4947 (4.8 KiB)

Install The RTL-SDR Libraires and Utilities

To install librtlsdr and sdr utilities like rtl_fm etc, use:

apt update; apt install rtl-sdr

(you will need to have already connected to network for this to work)


Shutting Down

Unlike Skylark, the root filesystem here is modified and is writeable, so it is important you shut this down properly:

sudo poweroff


Custom Startup Scripts for Skylark

User scripts:

Skylark 1.2 has support for starting a user script at bootup. For the technically inclined, look at /etc/init.d/S99user, that should tell you all.

Instructions:

1) first become root
sudo su -
2) then make a directory called bin in /mnt/conf
mkdir /mnt/conf/bin
3) in this directory create your script and call it user.sh
vi /mnt/conf/bin/user.sh

as an example, heres a script that logs the snr every 10 seconds

#!/bin/sh

while true
do
	a=$(wget -q -O - http://127.0.0.1/DIRECT/getTunerStatus | jq .result.snr)
	echo -n $(date) ": "
	echo $a
	sleep 10
done >> /mnt/downloads/snrlog.txt


4) make sure the script is executable, and owned by root
chown root:root /mnt/conf/bin/user.sh
chmod 755 /mnt/conf/bin/user.sh

Thats it. This script will automatically run at boot.

be careful though:


The script is run at the end of boot. So if you make changes to any service files or configs, you should restart that service as well. Be careful about how much RAM and CPU you consume in this script. Its a very limited system.



Hardware Details

Documentation

Adobe PDF icon.png AllWinner A13 Processor Datasheet

Adobe PDF icon.png AXP209 Power Management IC Datasheet


Board LEDS

Onboard LEDs can be controlled by writing to the ON/OFF Control file in SysFs. In the case of LED1/Pckts to turn on the led, write a 1 to the SYSFS Device On/Off Control.

To Turn the Led on:

echo 1 > /sys/class/leds/packet/brightness

To Turn it off:

echo 0 > /sys/class/leds/packet/brightness


CHGLED
Description Indicates LiPo Battery Charging
Color Green
Default at Boot OFF
SysFs Device
Usage
Notes indicate LiPo charge if it was used, but as it also introduces noise to the system LiPo powering option was eliminated



LED1 / Pckts
Description Flashes with Outernet Packets are Received
Color Green
Default at Boot OFF
SysFs Device /sys/class/leds/packet
Usage On/Off = brightness
Notes Unused in Armbian



LED2 / Flock
Description Satellite Lock Indicator on when satellite signal is locked
Color Red
Default at Boot OFF
SysFs Device /sys/class/leds/lock
Usage On/Off = brightness
Notes Unused in Armbian



LED3 / SNR1
Description SNR indicator
Color Blue
Default at Boot OFF
SysFs Device /sys/class/leds/snr1
Usage On/Off = brightness
Notes Unused in Armbian



LED4 / SNR2
Description SNR indicator
Color Blue
Default at Boot OFF
SysFs Device /sys/class/leds/snr2
Usage On/Off = brightness
Notes Unused in Armbian



LED5 / SNR3
Description SNR indicator
Color Blue
Default at Boot OFF
SysFs Device /sys/class/leds/snr3
Usage On/Off = brightness
Notes Unused in Armbian



LED6 / SNR4
Description SNR indicator
Color Blue
Default at Boot OFF
SysFs Device /sys/class/leds/snr4
Usage On/Off = brightness
Notes Unused in Armbian



LED7 / USR1
Description sdcard activity indicator. equivalent of the HDD activity light
Color Green
Default at Boot OFF
SysFs Device /sys/class/leds/storage
Usage On/Off = brightness
Notes



LED8 / USR2
Description heartbeat: flashes when kernel is booted and working normally.
Color Green
Default at Boot OFF
SysFs Device /sys/class/leds/heartbeat
Usage On/Off = brightness
Notes long off, N short flashes, long off, repeat, where N = 2 * Load_Average



LED9 / PWR
Description Power: White LED, on when board is powered.
Color White
Default at Boot ON
SysFs Device
Usage
Notes



LED10 / AGP3
Description Status indicator of Boot by default
Color Red
Default at Boot
SysFs Device
Usage
Notes AXP209.gpio2



LED11 / STATUS
Description
Color Green
Default at Boot
SysFs Device
Usage
Notes AXP209.gpio2



LED12 / USBH
Description USB Hub Indicator Light, Green when active
Color Green
Default at Boot ON
SysFs Device /sys/class/leds/usbhuben
Usage On/Off = brightness
Notes Turning this off, will disable all USB ports.



RF Ports

There are two RF ports on the DreamCatcher, they are labeled "LNA_IN" (at the corner of the board), and "LNA_BYPASS". They are SMA Type connections. To enable them you will write a 0 or a 1 to the appropriate SYSFS file location. Writing a 1 will enable it, and a 0 will disable it. if you enable one, you must disable the other;

NOTE: you must be a Superuser to control these... use "sudo su" first


Enable LNA_BYPASS

This is normally selected when you are using an external LNA, or Active Antenna
echo 1 > /sys/class/leds/rfswitch1/brightness
echo 0 > /sys/class/leds/rfswitch2/brightness


Enable LNA_IN

This would be used with a passive antenna or internal LNA
echo 0 >  /sys/class/leds/rfswitch1/brightness
echo 1 >/sys/class/leds/rfswitch2/brightness


Enable LNA_BYPASS Bias Tee

To Enable the bias tee, use the following commands
NOTE: 68 mA current limit set by R76/100k
echo 119 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio119/direction
echo 1 > /sys/class/gpio/gpio119/value


Enable Internal Audio Speaker Amplifier

sudo su
cd /sys/class/gpio
echo 114 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio114/direction
echo 1 > /sys/class/gpio/gpio114/value


Running “alsamixer”, turn up the volume (navigate with cursors, cursor up volume up) and un-mute all channels (pressing “m” key while cursor on them)

Alsamixer.png


Speaker amplifier output vias near C42, C43:

Dreamcatcher speaker.png

Temperature Monitoring

Armbian includes a monitoring application that gives you access to some of the hardware level details... for example to determine the CPU Temp use the following command:

armbianmonitor -m

however this of little use in automated monitoring or application development.


Usage: armbianmonitor [-h] [-b] [-c $path] [-d $device] [-D] [-m] [-p] [-r] [-u]

############################################################################

 Use armbianmonitor for the following tasks:

 armbianmonitor -c /path/to/test performs disk health/performance tests
 armbianmonitor -d monitors writes to $device
 armbianmonitor -D tries to upload debug disk info to improve armbianmonitor
 armbianmonitor -m provides simple CLI monitoring
 armbianmonitor -p tries to install cpuminer for performance measurements
 armbianmonitor -r tries to install RPi-Monitor
 armbianmonitor -u tries to upload armhwinfo.log for support purposes

############################################################################

Direct access to System Values

Board Temperature

The following returns the temperature of the CPU in Celsius

cat /sys/class/thermal/thermal_zone0/temp

Returns:

32900

This is the same as 32.9C

CPU Information
cat /proc/cpuinfo

Returns:

processor	: 0
model name	: ARMv7 Processor rev 2 (v7l)
BogoMIPS	: 858.75
Features	: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x3
CPU part	: 0xc08
CPU revision	: 2

Hardware	: Allwinner sun4i/sun5i Families
Revision	: 0000
Serial		: 1625428a0703290a
Processor Features
half
Half Word loads and stores
thumb
Thumb (16-bit instruction set)
fastmult
32×32→64-bit multiplication
vfp
VFP (early SIMD vector floating point instructions)
edsp
DSP extensions (the 'e' variant of the ARM9 CPUs, and all others above)
thumbee
ThumbEE
neon
Advanced SIMD/NEON on AArch32
vfpv3
VFP version 3
tls
TLS register
vfpd32
VFP with 32 D-registers
System Load Averages
cat /proc/loadavg

Returns:

0.96 0.79 0.75 1/115 19306

0.96 = Last One Minute CPU and IO Utilization

0.79 = Last 5 minute CPU and IO Utilization

0.75 = Last 10 minute CPU and IO Utilization

1/115 = Running processes / Total processes

19306 = Last process ID used

System Memory Usage
cat /proc/meminfo

Returns

MemTotal:         510684 kB
MemFree:           40648 kB
MemAvailable:     441480 kB
Buffers:          205240 kB
Cached:           191808 kB
SwapCached:            0 kB
Active:            87248 kB
Inactive:         342072 kB
Active(anon):      13624 kB
Inactive(anon):    18860 kB
Active(file):      73624 kB
Inactive(file):   323212 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:         510684 kB
LowFree:           40648 kB
SwapTotal:        251324 kB
SwapFree:         251324 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         32308 kB
Mapped:            21816 kB
Shmem:               212 kB
Slab:              25540 kB
SReclaimable:      15144 kB
SUnreclaim:        10396 kB
KernelStack:         936 kB
PageTables:          892 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      506664 kB
Committed_AS:     182860 kB
VmallocTotal:     507904 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
CmaTotal:          65536 kB
CmaFree:             648 kB


MemTotal
Total amount of physical RAM, in kilobytes.
MemFree
The amount of physical RAM, in kilobytes, left unused by the system.
Buffers
The amount of physical RAM, in kilobytes, used for file buffers.
Cached
The amount of physical RAM, in kilobytes, used as cache memory.
SwapCached
The amount of swap, in kilobytes, used as cache memory.
Active
The total amount of buffer or page cache memory, in kilobytes, that is in active use. This is memory that has been recently used and is usually not reclaimed for other purposes.
Inactive
The total amount of buffer or page cache memory, in kilobytes, that are free and available. This is memory that has not been recently used and can be reclaimed for other purposes.
HighTotal and HighFree
The total and free amount of memory, in kilobytes, that is not directly mapped into kernel space. The HighTotal value can vary based on the type of kernel used.
LowTotal and LowFree
The total and free amount of memory, in kilobytes, that is directly mapped into kernel space. The LowTotal value can vary based on the type of kernel used.
SwapTotal
The total amount of swap available, in kilobytes.
SwapFree
The total amount of swap free, in kilobytes.
Dirty
The total amount of memory, in kilobytes, waiting to be written back to the disk.
Writeback
The total amount of memory, in kilobytes, actively being written back to the disk.
Mapped
The total amount of memory, in kilobytes, which have been used to map devices, files, or libraries using the mmap command.
Slab
The total amount of memory, in kilobytes, used by the kernel to cache data structures for its own use.
Committed_AS
The total amount of memory, in kilobytes, estimated to complete the workload. This value represents the worst case scenario value, and also includes swap memory.
PageTables
The total amount of memory, in kilobytes, dedicated to the lowest page table level.
VMallocTotal
The total amount of memory, in kilobytes, of total allocated virtual address space.
VMallocUsed
The total amount of memory, in kilobytes, of used virtual address space.
VMallocChunk
The largest contiguous block of memory, in kilobytes, of available virtual address space.

TODO: I want to see how the RPi-Monitor works on the DreamCatcher, i know it works on the RaspberryPi and the OrangePi

Powering the Board Without a USB Cable

You can power the DreamCatcher with 5v to the JP1 current sense option jumper (+) and any convenient ground point such as the ground pin on the CHG-IN header.


Dc external power.jpg

Additional Headers

SPI1
Description Serial Peripheral Interface
MOSI Master Output, Slave Input
MISO Master Input, Slave Output
CS0 Slave Select
CLK Clock
GND Ground



SPI2
Description Serial Peripheral Interface
MOSI Master Output, Slave Input
MISO Master Input, Slave Output
CS0 Slave Select
CLK Clock
GND Ground



TWI2
Description Two Wire Interface (I2C)
GND Ground
3V3 3.3 Volt
SCK Serial Clock Line
SDA Serial Data Line



UART1
Description Universal Asynchronous Receiver/Transmitter
GND Ground
RX Receive Line
TX Transmit
3V3 3.3 Volt



JTAG
Description Joint Test Action Group
RESET_N Test Reset
GND Ground
TDO Test Data Out
TCK Test Clock
TMS Test Mode Select
TDI Test Data In
3V3 3.3 Volt



GPIO
Description These are in not in the correct order (what IS the CORRECT order?) Use the names to identify
5V0 5.0 Volt
GNDD1
PC15/NDQ7
PC13/NDQ5
PIN17/NRE
PC3/NCE1
PC1/NALE
PC19/NDQS
PG9/LED1
PG11/USBH
PE5
PB16
PB15
PE9
PE10
PE11
PB1
3V3
GNDD
GNDD2
PC14
PC4
PC2
PC0
PB10
PG10
PE4
PE6
PE7
PE8
PB4
PB3
PB2
PB0

Test Points

P1
Description



P4
Description



P7
Description



P5
Description



P3
Description



PWRON
Description



RESET
Description



AXPGP0
Description



AXPGP1
Description



AXPGP3
Description



AXPGP2
Description



NMI_N
Description



P11
Description



P12
Description



USBH_EN
Description



USB0_DRV
Description



SPK
Description



FACTORY
Description



LCD_020
Description



LCD_021
Description



LCD_022
Description



LCD_023
Description



LCD_CLK
Description



LCD_DE
Description



LCD_HSYNC
Description



LCD_VSYNC
Description



TPY2
Description



TPY1
Description



TPX1
Description



TPX2
Description



NON_REM1
Description



SDA
Description



SCL
Description



HS
Description




Outernet Specific Applications

Outernet Overview

NOTE: Complete Outernet support is provided by the SkyLark Release above. If you just want to play with Outernet, then using that build is much easier. The details for software setup below are more more advanced Outernet usage, without needing SkyLark..


Outernet overview.png


Outernet Broadcasts on L-Band satellite

Outernet satellite coverage.jpg


Satellite Details
Satellite Name Orbital Position Coverage Area Outernet Frequency Symbol Rate
I-4 F3 Americas 98°W North, South, and Central America, Pacific and Atlantic Oceans 1539.8725 MHz 4200
Alphasat 25°E Europe, Africa, Middle East, East Asia, Atlantic and Indian Oceans 1546.2500 MHz 4200
I-4 F1 APAC 144.0°E Asia, Australia, Pacific and Indian Oceans 1545.9525 MHz 4200


Adding a custom Frequency

From time to time the frequency used for the Outernet datastream will change. This is the proper workaround for adding a new custom frequency:

1) Connect by terminal to your Dreamcatcher using the "outernet" user account


2) Open this config file with VI editor with "Sudo", edit then save
"sudo vi /mnt/conf/etc/skylark_config.json"
Enter the "outernet" user password when prompted for a password


3) Edit only the custom frequency and symbol rate setting (every other will change back on reboot)
"custom": {
     "label": "Custom",
     "value": "custom",
     "freq": "1546.25",
     "symbolrate": "4200"
}


4) Set the Outernet application to use the custom frequency
Open the "Tuner" Application
Select the "Satellite" tab

"Select "Custom" from the dropdown

Outernet tuner custom freq.png

ONDD Setup

FTP to a DreamCatcher, copy the following files off of the system... be SURE to FORCE binary transfer.

/usr/sbin/ondd(md5:207723be33f4da57bd64a6549e11e95d)
/usr/sbin/ontimeout (md5:5092f17f0152ca352799290999ba7a6c)


Create an empty conf file

/etc/ondd/ondd.conf

Create a place to place downloads

/home/downloads (or wherever)

Create a place for download cache

/home/download_cache

Run ondd with the following command:

/usr/sbin/ondd -d --pid_file /var/run/ondd.pid --cfg-gile [empty cfg file you created] -c [location for download cache] -o [location for completed downloads] -D /var/run/ondd.data --sdr-timeout-handler /usr/sbin/ontimeout


Command Help

[Skylark][outernet@outernet:/usr/sbin]$ /usr/sbin/ondd -h
00:11:21.099 [main] Unable to load config: /etc/ondd.conf (null)
Usage: ondd 
--cfg-file CONFIG_FILE override default config file location
--pid-file PID_FILE override default pid file location
--ctrl-sock SOCK_FILE override default control socket path used for ipc
--status-sock SOCK_FILE override default status report socket path - status e
--cert-file CERT_FILE override default ceritificate file location
-D SOCK_FILE data socket path to which the demodulator sends raw s
--sdr-timeout-handler script to execute if no data arrives through the date
-o PATH path to output directory where downloaded files are d
-c PATH path to cache directory where partially downloaded fd
-O PATH if specified, files which path does not begin with td
-b N set the maximum number of download completion eventsy
-d start ondd in daemon mode
-i print to stdout the current signal strength and snr,d
-V enable verbose mode
-v display ondd version info
-h display this helptext


External API Access

Skylark has 3 known access points for external api access. These APIs provide access to specific items in a JSON format. They do not require login and are enabled by default as far as we can tell (version 4.4)

getTunerStatus

This provides the tuner connection status which is the same as what is available in the ui under Tuner-->Status tab.

Access URL

http://10.0.0.1/DIRECT/getTunerStatus

The following values are provided:


getTunerStatus Values
JSON Parameter Description Example Value
error Indicates by TRUE or FALSE if there was an error in processing the request false
result contains the complete parameter value set (see below)


getTunerStatus "result" Parameter Values
JSON Value Description Example
event "packet_received"
event_details
lock Indicates the status of the satellite lock where:

0 = Not Locked

1 = Locked

1
freq Frequency the receiver is tuned to. 1539.87
freq_offset The frequency offset in Hz from the Primary frequency
set_rs
rssi Received signal strength indication (dBm)
snr Signal to Noise Ratio Indicates the strength of the incoming signal to the device, must be higher than 3.0 to 4.0 for a quality locked signal
ser Symbol Error Rate The rate of error for the received packet stream
crc_ok The number of packets that passed the CRC check 317628
crc_err The number of packets that failed the CRC check 0
alg_pk_mn This describes how much the signal stands out from the noise. 28.06
state Indicates the current signal lock state, where:

0 = Search

1 = Signal Detect

2 = Const Lock

3 = Code Lock

4 = Frame Lock

4
transfers This is a JSON Array that contains the current transfers in progress. Although this is usually just one item, the code clearly supports multiple simultaneous downloads (See Below)


getTunerStatus "result" --> "Transfer" Parameter Values
JSON Value Description Example
carousel_id
path File path for the download object
hash
block_count
block_received
complete

example JSON:

{
	"result": {
		"event": "packet_received",
		"event_details": "",
		"lock": 1,
		"freq": 1539.87,
		"freq_offset": -2557.35,
		"set_rs": 4200,
		"rssi": -116.74,
		"snr": 11.58,
		"ser": 0,
		"crc_ok": 317628,
		"crc_err": 0,
		"alg_pk_mn": 28.06,
		"state": 4,
		"transfers": [{
			"carousel_id": 2,
			"path": "opaks/58d9-news-pack.2017-09-05_1743.tbz2",
			"hash": "bb4d85e4e41c190780b67dc44aee2add2be413137f6aee0c197052281a8c902d",
			"block_count": 225,
			"block_received": 136,
			"complete": 0
		}, {}]
	},
	"error": false
}


Duplicating the UI Tuner Status

the UI tuner status provides some values that must be calculated from the API Values provided above.

Implementing the Tuner UI Values
UI Label API Value(s) Calculation
SNR (dB) snr snr
Lock lock lock? "yes" : "no"
Rssi (dBm) rssi rssi
APkMn Ratio alg_pk_mn alg_pk_mn
Frequency (MHz) freq freq
Freq Offset (Hz) freq_offset freq_offset
Symbol Error Rate (SER) ser ser
Packets Received crc_ok, crc_err crc_ok + crc_err
Valid Packets crc_ok crc_ok
Valid packets % crc_ok, crc_err round(100*crc_ok / (crc_ok + crc_err)
Packet Error Rate (PER) crc_err, crc_ok round(1000*crc_err/ (crc_ok + crc_err) ) / 1000
Lock State state 0=Search, 1=Signal Detect, 2=Const Lock, 3=Code Lock, 4=Frame Lock
Transfers: path, block_received, block_count path + (round( 100 * block_received / block_count)) + "%"


getAPRS

This interface provides a complete listing of the received APRS messages.


Access URL

http://10.0.0.1/DIRECT/getAPRS


getTunerStatus Values
JSON Value Description Example
result
error


example JSON:

{
	"result": "KE7WWT-1>APMI01,TCPIP*,qAS,KE7WWT:OUTNET\n
  KE7WWT-1>APMI01,TCPIP*,qAS,KE7WWT:OUTNET\n
  KE7WWT-1>APMI01,TCPIP*,qAS,KE7WWT:OUTNET\n",
	"error": false
}


whatsNew

provides a list of the whats new listing


Access URL

http://10.0.0.1/DIRECT/whatsNew


getTunerStatus Values
JSON Value Description
result Complete result set, separated by "\n" between rows
error


Example JSON:

{"result":
	"1504634234,combined.js\n
 	1504634005,Amateur Radio/APRS/APRSAT/messages-2017-09-05_17:53.txt\n
 	1504633409,News/2017-09-05.EurekAlert - Breaking News.NASA sees development of Tropical Depression 19W.html\n
 	1504633409,News/2017-09-05.EurekAlert - Breaking News.Opioid abuse can be treated successfully in primary care settings, stud.html\n
 	1504633408,News/2017-09-05.EurekAlert - Breaking News.Eating meat linked to higher risk of diabetes.html\n",
 "error":false}


Running Custom Scripts

The Skylark release for the DreamCatcher is a read only system. Although there are logs and data written to certain locations, you cannot install additional applications on the system with tools such as apt and yum. You can however, run scripts at boot that may be used to start other services as needed.


Since version 1.2 Skylark has support for starting a user script at bootup. For the technically inclined, look at /etc/init.d/S99user, that should tell you all.

Installing User Boot Script
first become root
sudo su -
then make a directory called bin in /mnt/conf
mkdir /mnt/conf/bin
in this directory create your script and call it user.sh
vi /mnt/conf/bin/user.sh

as an example, heres a script that logs the snr every 10 seconds

#!/bin/sh

while true
do
	a=$(wget -q -O - http://127.0.0.1/DIRECT/getTunerStatus | jq .result.snr)
	echo -n $(date) ": "
	echo $a
	sleep 10
done >> /mnt/downloads/snrlog.txt
make sure the script is executable, and owned by root
chown root:root /mnt/conf/bin/user.sh
chmod 755 /mnt/conf/bin/user.sh


NOTE: be careful though:

The script is run at the end of boot. So if you make changes to any service files or configs, you should restart that service as well. Be careful about how much RAM and CPU you consume in this script. Its a very limited system.


ADS-B reception using dump1090

Install Updates and Base Packages

sudo apt-mark hold linux-dtb-next-sunxi linux-headers-next-sunxi linux-image-next-sunxi linux-firmware-image-next-sunxi 
sudo apt update
sudo apt upgrade
sudo apt install rtl-sdr librtlsdr-dev pkg-config build-essential
wget https://raw.githubusercontent.com/keenerd/rtl-sdr/master/rtl-sdr.rules
sudo mv rtl-sdr.rules /etc/udev/rules.d/

Reboot the DreamCatcher

sudo reboot

Install dump1090

Download and compile dump1090 (one time only):

mkdir adsb
cd adsb
git clone https://github.com/MalcolmRobb/dump1090
cd dump1090
make

Antennas

Hook-up a 1090MHz antenna, suitable for ADS-B reception to the LNA_BYPASS RF input of Dreamcatcher. You can find some good starting points here: http://discussions.flightaware.com/ads-b-flight-tracking-f21/three-easy-diy-antennas-for-beginners-t20177.html


Running dump1090

echo 1 | sudo tee /sys/class/leds/rfswitch1/brightness
echo 0 | sudo tee /sys/class/leds/rfswitch2/brightness
./dump1090 --interactive --net

NOTE: The “rfswitch1” and “rfswitch2” lines are not strictly necessary, but will not hurt anything - the Dreamcatcher Armbian image ships with the LNA bypass enabled by default.

Running dump1090 as a daemon

if you dump1090 to run in the background after a reboot, you need to set it up as a daemon.

Create a Startup script in /etc/init.d

The following is a sample startup script. This was poached from this site: http://www.satsignal.eu/raspberry-pi/dump1090.html

  • Create a simple script in /etc/init.d, in my case i called it, dump1090.sh
  • Cut and paste the following into the file
#!/bin/bash
### BEGIN INIT INFO
#
# Provides:		dump1090
# Required-Start:	$remote_fs
# Required-Stop:	$remote_fs
# Default-Start:	2 3 4 5
# Default-Stop:		0 1 6
# Short-Description:	dump1090 initscript

#
### END INIT INFO
## Fill in name of program here.
PROG="dump1090"
PROG_PATH="/home/pi/dump1090"
PROG_ARGS="--interactive --net --no-fix --net-ro-size 500 --net-ro-rate 5 --net-heartbeat 60 --gain -10"
PIDFILE="/var/run/dump1090.pid"

start() {
      if [ -e $PIDFILE ]; then
          ## Program is running, exit with error.
          echo "Error! $PROG is currently running!" 1>&2
          exit 1
      else
          ## Change from /dev/null to something like /var/log/$PROG if you want to save output.
          cd $PROG_PATH
          ./$PROG $PROG_ARGS 2>&1 >/dev/null &
          echo "$PROG started"
          touch $PIDFILE
      fi
}

stop() {
      if [ -e $PIDFILE ]; then
          ## Program is running, so stop it
         echo "$PROG is running"
         killall $PROG
         rm -f $PIDFILE
         echo "$PROG stopped"
      else
          ## Program is not running, exit with error.
          echo "Error! $PROG not started!" 1>&2
          exit 1
      fi
}

## Check to see if we are running as root first.
## Found at http://www.cyberciti.biz/tips/shell-root-user-check-script.html
if [ "$(id -u)" != "0" ]; then
      echo "This script must be run as root" 1>&2
      exit 1
fi

case "$1" in
      start)
          start
          exit 0
      ;;
      stop)
          stop
          exit 0
      ;;
      reload|restart|force-reload)
          stop
          start
          exit 0
      ;;
      **)
          echo "Usage: $0 {start|stop|reload}" 1>&2
          exit 1
      ;;
esac
exit 0

NOTE: You need to alter the PROG_PATH value to the location of your dump1090 application

  • Set the permission to executable
    sudo chmod +x /etc/init.d/dump1090.sh
  • Install to the startup directories
    sudo update-rc.d dump1090.sh defaults
  • If you want to remove it later
    sudo update-rc.d -f dump1090.sh remove
  • Test Start the application
    sudo /etc/init.d/dump1090.sh start
  • NOTE: If you want to stop it
    sudo /etc/init.d/dump1090.sh stop

Verify that it is running

To verify that the application is running connect to the IP Address of the system and 8080 like

http://10.0.1.150:8080

you should see a map load..


Running the Dreamcatcher SDR from another System

The SDR on the dreamcatcher is connected the the CPU via USB, this connection can be changed to an external USB and the SDR can be connected to another systems USB. Doing this will prevent the SDR from being used by the dreamcatcher.


To Do this:

  1. Populate USB1 connector (or just solder wires for a usb pigtail cable)
  2. Remove R72 and R73 and move them to the R116 and R117 footprints.


This will disconnect the SDR from the usb hub on the DreamCatcher and route it's usb to the external cable.


Listen to FM broadcasts

Its possible to listen to standard FM broadcast radio using the Dreamcatchers SDR.

Install necessary Software

sudo apt install rtl-sdr sox


Enable sound output through the 3.5mm TRRS connector

alsamixer

Enable every column except the second and third by pressing “m” (for mute/unmute) when the column is selected. Use the keyboard left-arrow and right-arrow keys to move among the columns. For the second column, use up-arrow and down-arrow keys to adjust output volume. Be careful to not set it too high; if the column color changes to white, it has been set too high. Leave the third column muted.

You may have to reset theseAon every boot. Alternatively, you can save and restore them using: sudo /usr/sbin/alsactl store sudo /usr/sbin/alsactl restore

Connect a TRRS (tip-ring-ring-sleeve) headset cable - the kind you might use with an Android phone - to the 3.5mm connector on Dreamcatcher that is labelled “headphn”. This has 4 conductors - a “normal” set of headphones has 3.

Run this:


rtl_fm -f 104.7M -M fm -s 340k -A fast -r 32k -l 0 -E deemp | play -r 32k -t raw -e s -b 16 -c 1 -V1 -

More information about the various command line options is at the rtl_fm homepage at http://kmkeen.com/rtl-demod-guide/


Obviously, the most important one is the -f option for selecting the tuned frequency. You may also have to play around with the -s if the output is noisy. FM broadcasts tend to be quite powerful signals, and I have not needed an antenna for receiving any of the local stations, but in case of bad reception, just adding a sub-1M SMA cable at the LNA_BYPASS RF input of the Dreamcatcher should improve reception dramatically.

Modify the Tuner application to add Frequencies

Although this isnt all that useful unless you want to have lots of entries in the satellite list that won't work, it is important to know how all this works so you can if you need to later...

Skylark is read only, so to make these changes, you will need to use the User.sh service scripts to re-install the changes after every reboot, then restart the ui service.

Create a Custom skylark_config.json file Modify your custom skylark_config.json file and copy to the proper locations (if you dont have this file, copy /etc/skylark_config.json to this location

Add the new entries to the "tunerConf" section Add new entires for each new satellite entry, note the entries for sat1, sat2, sat3 below:

"tunerConf": {

               "beams": {
                        "sat1": {                                                                     
                               "label": "Satellite 1",                                            
                               "value": "sat1",                                                     
                               "freq": "1545.1111",                                                 
                               "symbolrate": "4200"                                                 
                       },   
                       "sat2": {                                                                     
                               "label": "Satellite 2",                                            
                               "value": "sat2",                                                     
                               "freq": "1545.2222",                                                 
                               "symbolrate": "4200"                                                 
                       },   
                       "sat3": {                                                                     
                               "label": "Satellite 3",                                            
                               "value": "sat3",                                                     
                               "freq": "1545.3333",                                                 
                               "symbolrate": "4200"                                                 
                       },   
                       "apac": {
                               "label": "Asia Pacific (144E)",
                               "value": "apac",
                               "freq": "1545.9525",
                               "symbolrate": "4200"
                       },
                       "emea": {
                               "label": "Europe, West Asia, Africa (25E)",
                               "value": "emea",
                               "freq": "1545.94",
                               "symbolrate": "4200"
                       },
                       "americas": {
                               "label": "Americas (98W)",
                               "value": "americas",
                               "freq": "1539.8725",
                               "symbolrate": "4200"
                       },
                       "custom": {
                               "label": "Custom",
                               "value": "custom",
                               "freq": "1546.25",
                               "symbolrate": "4200"
                       }
               },
               "selectedBeam": "americas"
       },

Add the new entries to the "overRide" section. This will allow the new entries to remain after a reboot.

"overRides": [

               "netConf.hostname",
               "netConf.mode",
               "netConf.sta",
               "netConf.ap",
               "tunerConf.selectedBeam",
               "tunerConf.beams.custom",
               "tunerConf.beams.sat1",
               "tunerConf.beams.sat2",
               "tunerConf.beams.sat3"
       ]

save the new skylark_config.json file to /mnt/conf/bin check the file syntax with "jq -c < skylark_config.json"

Add a user.sh script to /mnt/config/bin directory NOTE: in order to get this to work reliably i needed to copy the config to both places. im sure in my reverse engineering that i missed something simple, but this worked..

  1. !/bin/sh
  2. copy the skylark config to /mnt/conf/etc

cp /mnt/conf/bin/skylark_config.json /mnt/conf/etc/skylark_config.json

  1. copy the skylark config to /etc

cp -f /mnt/conf/bin/skylark_config.json /etc

  1. restart the ui service

/etc/init.d/S70ui2service restart reboot your DC to see how it works...


Install a custom applicaiton to skylark 4.4

I've wanted to add some custom applications to the DC running SkyLark (currently 4.4).. this is the process to install it so it remains after a reboot.. Although Skylark is based on the OS.js platform (https://www.os-js.org/), its customized quite a bit.

Additionally Skylark is read only, any changes you make will be overwritten on the next reboot. To get around this, we will use the user script service to re-install the customizations after every reboot, then bounce the window manager.

Create your custom application you can use an existing application as a template, but you will need to modify much of it so its unique. Developing the application is beyond the scope of this post, and requires more effort. (mine clearly needs some work, but wanted to document this first)

Existing applications can be found in: /usr/share/www/packages/default copy one of these to your writable location.. in my case it was /mnt/conf/bin modify the application as required.

Create Custom Icons you will need both 16x16 and 32x32 size icons store these in your writable location for example /mnt/conf/bin

Create a custom packages.json Copy the packages.json file from /usr/lib/node_modules/ui2 to your writable location.. /mnt/conf/bin

modify the file adding an entry to the "www" group for your new application... Check the syntax of the file with "jq -c < packages.json" when your complete.

for my example i added the following..

"default/RACHEL": {

           "className": "ApplicationRachel",                
           "name": "RACHEL",                                                    
           "mime": null,                                                   
           "icon": "apps/RACHEL.png",                                          
           "category": "utilities",                                
           "preload": [                                                     
               {                                                            
                   "type": "javascript",                                           
                   "src": "combined.js"                                     
               },                                                                  
               {                                             
                   "src": "scheme.html",                                    
                   "type": "scheme"                                        
               },                                                           
               {                                                               
                   "type": "stylesheet",                                    
                   "src": "combined.css"                                    
               }                                                   
           ],                                                               
           "type": "application",                                           
           "path": "default/RACHEL",                                     
           "build": {},                                                     
           "repo": "default"      
        }

Add a User Service Script Create a "user.sh" script to place all the files in the proper place then restart the ui service..

  1. !/bin/sh

cp -f /mnt/conf/bin/packages.json /usr/lib/node_modules/ui2 chmod 644 /usr/lib/node_modules/ui2/packages.json

cp -R /mnt/conf/bin/RACHEL /usr/share/www/packages/default chmod 755 /mnt/conf/bin/RACHEL

cp -f /mnt/conf/bin/RACHEL_16x16.png /usr/share/www/themes/icons/default/16x16/apps/RACHEL.png

cp -f /mnt/conf/bin/RACHEL_32x32.png /usr/share/www/themes/icons/default/32x32/apps/RACHEL.png

/etc/init.d/S70ui2service restart when you goto the Skylark Web UI, you will see your new application..