Outernet Receiver L-Band and APRS Antenna design Competition

I would be happy to share a full compiler toolchain (with its sysroot - all headers etc) for you to build your binaries with , if thats something you are interested in doing. Let me know.

Syed

I am really sorry but I have been absolutely hijacked by some problems back home and I am making preparations to go and sort them out.Would it be ok if we postponed announcing the competition for two weeks until I get these distractions under control.

Seasalt.

You are my hero. This looks amazing. I can not wait to see how this works out.

Seasalt

Let me keep that in mind. In the meantime I will see what the CHIP team is up to with PWM in their system.

Thank you Abhishek.

-Cecil

@Abhishek

It looks like PWM is available in sysfs of the chip build but there is no control node in /sys/class/pwm on the outernet node. Is it enabled in the buildroot device tree? There should be a pwmchip0 in there. Is there room for it in the image?

With that I should be able to build a tracker shell script with the I2C and the hardware pwm.

Thanks again!

-Cecil

can you get me the entries? I am sure I can add those.

better yet, I have uploaded the dtb editing tools (fdtdump, fdtget, fdtput) at We Moved!

you can put them on the CHIP and use these to edit the binary dtb to enable pwm. Thats probably easier and faster than having to ask me.

the dtb is in /boot. If you put the binaries somewhere under /mnt/downloads, they won’t be lost on reboot.

Note that after an OTA, your modded dtb will be overwritten back to stock. so keep a copy.

Also, let me know the changes you made once you have it working, and i’ll see about integrating those in the stock dtb.

I’ll see about uploading a bc binary as well.

this might be a better solution than having to include every tool in stock image.

edit: bc is up there as well.

Thanks!

For those who building gimbal antenna stabilizer / sat tracker for mobile use, a motion tracker circuitry will be needed to stabilize the antenna. The cheapest CNC gimbal (for go pro use on drones) uses this MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS IC: MPU-6050 | TDK

http://www.ebay.com/itm/CNC-FPV-BGC-2-Axis-Brushless-Gimbal-Gimbal-Controller-for-GoPro-3-Camera-DJI-/161837635797

I have the dtb edited where I think it may work. But here is the trick question. What is the best way to write it back to boot since the ubi0:linux filesystem is mounted ro on /boot?

Thanks
-Cecil

$ sudo su -
$ chbootfsmode
$ touch /boot/a # or whatever
$ chbootfsmode

do not change the names etc of files already there. That will break boot. Also, /boot should have lots of free space, or OTA will break. do not store extra stuff there. a few KB should be fine.

Thanks for the warning, I was going to keep a copy of the original dtb there by renaming it. You caught me just in time.

-C

Okay the PWM device was built in the device table blob, so getting it available was mostly a fight with setting up the tools and finding the correct node in the table to edit. Here are my notes.

First off, you will need to grab the fdt edit files from the outernet server that @Abhishek posted above. We are going to make a file in the downloads folder named tools to place them in. Get started by using ssh to log into your CHIP. Username: outernet Password: outernet

All of these of commands will be run as root, so we are going to just change over to root instead of sudo’ing everything.

sudo su -

Password again: outernet
Then we will make our directory to hold our tool files.

cd /mnt/downloads/
We make a directory…

mkdir tools
and then set the permissions…

chmod 755 tools
and change into the dir.

cd tools
Now we will pull the files from the internet.

wget https://archive.outernet.is/images/chip-tools/fdttools/fdtdump
wget https://archive.outernet.is/images/chip-tools/fdttools/fdtget
wget https://archive.outernet.is/images/chip-tools/fdttools/fdtput
Set our permissions again, do this one at a time if you have other files in this directory. Otherwise…

chmod 755 *
Now make the /boot file system read/write. As Abhishek noted above do not monkey around with any files here, your CHIP will stop booting.

chbootfsmode
So lets go play with those files we should not play wirh…

cd /boot
And lets patch up the device tree to turn on the PWM hardware. (see note 1 at the bottom)

/mnt/downloads/tools/fdtput -t s sun5i-r8-chip.dtb /soc/pwm status okay
That line patched up the device tree, now for the cleanup.

cd /
sync
chbootfsmode
We should be about done here. It’s time to power off and reboot. I had issues with reboot, YMMV.

poweroff

At this time you should be able to press the power button on the chip to boot back up. To see if things worked after the system restarts log in and…

cd /sys/class/pwm
ls
You should now see the control node pwmchip0. That is what you want to use the HW PWM, perfect for driving your servo. Good luck. See the NextThingCo boards for more info on how to set this up, a shell script can do all the work from here. If you need some floating point math that is what the other file “bc” is for. Look up there in the outernet archinve for the executable bin.

/*
NOTE 1
It seems that few if any people edit device tree blob files. Every discussion I could find generally referenced working with the device tree during the kernel build setup scripts. So I just ended up banging away with fdtget until I understood the filesystem type structure that was in the compiled device blob. Anyhow I don’t recommend trying to find or learn this from google searching.

UBIFS flash file systems are slightly better documented than DTB’s are, but I had barely found the chbootfsmode command (in the outernet docs on compiling your own kernel) when Abhishck warned me about how easy you can corrupt them. I can only guess how big a pain in the sas it was to find how to build this, I will be watching to see how the OTA overlays work with this filesystem. I am not sure how needed that ‘sync’ is before I switched /boot back to read only, but I thought better safe than sorry.
*/

-Cecil
AA5CE

1 Like

brilliant! thanks for writing up the whole process!

I found the following shell commands over on the CHIP forums. Not the greatest docs, but it should at least let people get the PWM system to put out a signal. I have not gotten to pull out my logic analiser to see if it works or not. So take it as it is. Post up any results you get from playing with it.

request device- must be done before any of the following settings can be changed

sudo sh -c ‘echo 0 > /sys/class/pwm/pwmchip0/export’

set the polarity to active HIGH (echo normal) or active LOW (echo inversed)- must be done before enabled

sudo sh -c ‘echo normal > /sys/class/pwm/pwmchip0/pwm0/polarity’

enable PWM channel using set- must be done before period or duty_cycle are set)

sudo sh -c ‘echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable’

set the period to 1 second (adjust as needed in nanoseconds)

sudo sh -c ‘echo 1000000000 > /sys/class/pwm/pwmchip0/pwm0/period’

set the duty cycle to 500 ms (adjust as needed in nanoseconds)

sudo sh -c ‘echo 500000000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle’

Once you’re done you can disable/free the device:

disable device

sudo sh -c ‘echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable’

free device

sudo sh -c ‘echo 0 > /sys/class/pwm/pwmchip0/unexport’

There seem to be quite a few other functions exposed in the sysfs interface. If anyone has the full docs for the PWM please post them.

-C

The instructions above are missing one step in the PWM startup. Once you set the duty cycle you still have to turn on the power to the pin. Funny enough, this is not a step that is needed on other sysfs pwm setups that I have seen. So, please add this last command to get pwm to start.

Set the power on to the PWM pin. There may be some other interesting things available here. But I have no docs.

sudo sh -c ‘echo auto > /sys/class/pwm/pwmchip0/pwm0/power/control’

Wasted another half a day to find this missing little jewel.
Like most of the rest of the CHIP, the pwm system is 3.3v. So careful with the levels.

-Cecil

@Abhishek After crawling a bit down device trees I don’t know how you put up with that build system. I was never able to find the origion of the device tree to edit to enable the PWM if I wanted to build a system from scratch The Docs suck.

Sometime when you get a chance put your .config file up for us to look at for the rxos build.

-C

now you know what I put up with for my users!

:wink:

just kidding - the configs are in rxos/configs inside the tree, for example:

rxOS/blob/chip/develop/rxos/configs/chip_kernel_defconfig

for the dts source, look at

CHIP-linux/tree/debian/4.4.11-outernet-1

in arch/arm/boot - the sun5i-* set is the one you need.

1 Like

how to build:

git clone --recursive https://github.com/Outernet-Project/rxOS.git -b release/4.2

cd rxOS

./chip

(you may have to edit the “chip” script to comment out the “exit” line near the top)
also, you will need a signing key before the build will fully complete. PM and I’ll make one for you.

1 Like

Think the competition idea is great!. When you say Outernet receiver, are you referring to the Outernet lantern or the E4000? It’d be great to clear that up.
Some thoughts on the categories:

  • first two and no 7 could be combined into one to provide a challenge, with added price limit and construction tools restrictions, e.g. no power tools. fresh infusion of creative thinking might do the competition some good.
  • best mobile antenna - size, complexity and price as judgement criteria, as someone with a 3D printer and or access the machining tools can make a pro level gimbal mount.
  • highest SNR antenna - a large dish or arrays are better, some restrictions might be in order, or not, would be great what SNR others get with a 5 m dish, but then housing a large dish is not easy.
    Furthermore, equipment for judging for SNR should be worked out, I suggest rtl-sdr.com v.3 dongle with outernet preamp and CHIP as that’s what everyone uses.

Looking forward to the competition, PM me if you need any help with any aspects of organising. I’m more than happy to provide space on radioforeveryone.com, can provide access to the domain to Seasalt for entries for those who have no webpage / blog, and will happily devote my time to showcasing and organising designs coming in via eamils as necessary.
I think the competition should involve rtl-sdr.com as well.

1 Like