# Which version of FreeBSD for RPi 1 Model B ?



## balanga (Apr 27, 2017)

I've had a RPi 1 Model B languishing in a drawer for a couple of years and not really done much with it. I did try installing FreeBSD on it at one time without success, but wondered what the current state of play was. Which version should I try, and is there any support for the  Piface Digital which I've never really done anything with apart from switch a light on and off....


----------



## ralphbsz (Apr 27, 2017)

Hmmm.  For my Pi 3, I simply went to raspbsd.org, downloaded the iso file, dd'ed it onto an SD card, plugged it in, booted, and ran (reasonably successfully, with glitches here and there).  BUT: there are no images for anything older than RPi 1 model B+ and RPI 2/3 there.  Hmmm.  Not a helpful suggestion.


----------



## balanga (Apr 28, 2017)

I did not see anything related to RPi B so I guess it's time to consign my RPi to the Linux bin and get a new RPi...


----------



## Phishfry (Apr 28, 2017)

What about the image on the download page? It says RPI-B
https://www.freebsd.org/where.html
https://download.freebsd.org/ftp/re...0/FreeBSD-11.0-RELEASE-arm-armv6-RPI-B.img.xz


----------



## balanga (Apr 29, 2017)

I download this and it started to boot but ended up with an error... Where would I find installation instructions? 

It's odd that there is no mention on https://www.raspberrypi.org/downloads/ about FreeBSD being an option...


----------



## Phishfry (Apr 29, 2017)

I don't own a RPi 1 so I cannot test this. I just know the image name looks like it is correct for your board.
Maybe it is for B+ and they dropped off the plus sign. I dunno.


----------



## balanga (Apr 29, 2017)

Maybe I haven't installed it properly, it does start to boot but numerous errors occur such as 

```
** Unable to read file uEnv.txt **

...

Booting from: mmc 0 ubldr.bin
reading ubldr.bin
223912 bytes read at 30 ms (7.1 MiB/s)
## No elf image at address 0x00200000

...

Booting from disk0s2a:

can't load 'kernel'
```


----------



## ralphbsz (Apr 30, 2017)

Looks like copying the boot image to the media didn't work correctly.


----------



## balanga (May 1, 2017)

I tried again using `dd`

It created two partitions,  an MSDOSFS partition and a UFS partition, which I have been able to mount on another system.

There is no uEnv.txt on the MSDOSFS partition although there is a ubldr.bin. How do I get hold of this file?

There is no kernel file on the UFS partition....

Just wondering if anyone has this working? There doesn't really seem to be that much that could go wrong if the archive is OK. Maybe I'll try an older version...


----------



## ralphbsz (May 1, 2017)

I don't understand.  You created partitions?

For my RPI3, I simply took the .img file, uncompressed it, and copied it with `dd` to the whole SD card (no partitions).  The SD card then ends up containing BSD slices (device names mmcsd0sN, where N=1,2 or 2a), but hose were inside the image.


----------



## balanga (May 1, 2017)

I didn't create partitions myself, I just ran dd which must have created the partitions on the SD card. I guess I need to find someone who has the RPIB working, as it sounds different to RPI3. Maybe I'll download the RPI3 image and see how that looks on the SD card when extracted.


----------



## SirDice (May 2, 2017)

Try a different SD card. If I recall correctly the Pi 1 is a bit finicky regarding cards, not all of them work without problems.


----------



## balanga (May 18, 2017)

Phishfry said:


> What about the image on the download page? It says RPI-B
> https://www.freebsd.org/where.html
> https://download.freebsd.org/ftp/re...0/FreeBSD-11.0-RELEASE-arm-armv6-RPI-B.img.xz



I've come across these two links which seem to go round in circles when it comes to links for RPi-B..

https://www.freebsdnews.com/2016/08/19/installing-freebsd-raspberry-pi/

https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-freebsd-for-raspberry-pi/


----------



## trev (May 21, 2017)

Stable 11 snapshot images for RPi Model B can be found here:

https://download.freebsd.org/ftp/snapshots/arm/armv6/ISO-IMAGES/11.0/


----------



## castoch (May 25, 2017)

There an Free BSD for pi 3 ?


----------



## ralphbsz (May 25, 2017)

Yes there is.  Running on my workbench at home.  You log in, and it looks exactly like a normal FreeBSD ... until you start looking at the performance.  You download it from the RaspBSD website.  If you look in some other thread, you'll even find a discussion of some details.  There are certain restrictions (like the wireless doesn't work, there is no emacs, and you have to use a weird setup for packages).  Xwindows even works (even on the 7" display, although I haven't had time to enable the touch aspect).  So far I haven't found any software other than emacs that is missing (although I haven't had much time to try everything).  GPIO works out of the box (I can turn a LED on and sense a toggle switch).  I like it better than Raspbian, but that's really a question of taste and usage requirements.


----------



## asteriskRoss (May 25, 2017)

RPi 1 Model B works just fine for me with the FreeBSD 11.0 image.  I used mine as a wireless bridge for a little while.  Lack of official precompiled ports and updates put me off trying to do anything more meaningful with it.


----------



## balanga (May 26, 2017)

asteriskRoss said:


> RPi 1 Model B works just fine for me with the FreeBSD 11.0 image.  I used mine as a wireless bridge for a little while.  Lack of official precompiled ports and updates put me off trying to do anything more meaningful with it.



It's good to know that someone has it working, since I had problems trying to boot it up, but as was mentioned earlier it could have been due to using the wrong type of card. What type/size are you using?

What's the best forum for RaspBSD?


----------



## balanga (May 26, 2017)

There seems to be something missing here:-

http://www.raspbsd.org/raspberrypi.html


----------



## balanga (May 26, 2017)

After much trial and error I've finally managed to get to a FreeBSD login prompt on my Raspberry Pi!!!

This was with 12.0...  This was the 17 Jan version, the latest version (29 Mar) would not load.


----------



## balanga (May 26, 2017)

Just tried the '312722M' version and that worked.... but got


> /tmp: write failed, filesystem is full



after `pkg install pkg`

I'm using an 8GB SDHC card. Any recommendation on size of card required?


----------



## Phishfry (May 26, 2017)

Here are some breadcrumbs
https://forums.freebsd.org/threads/61010/#post-351138


----------



## obsigna (May 26, 2017)

balanga said:


> Just tried the '312722M' version and that worked.... but got
> 
> 
> > /tmp: write failed, filesystem is full
> ...



Look closer on the error message. It tells you that /tmp is full, which does not imply that all the space of your SC card has been consumed. In order to increase the tmpfs(5) filesystem, edit /etc/fstab and change 50m to 100m

```
tmpfs      /tmp        tmpfs    rw,mode=1777,size=100m   0    0
```
 Then restart.


----------



## balanga (May 26, 2017)

Mine has:-

```
md      /tmp     mfs  rw,noatime,-s30m    0  0
```

What should it look like?

And which version are you using?


----------



## ralphbsz (May 27, 2017)

This was discussed in another thread.  The default has 30M (that's the -s30m) for /tmp and another 30M for /var/tmp, which in my opinion is a waste, since hardly anything ever uses /var/tmp.  So I changed the line for /tmp to have "-s60m", and commented out the line for /var/tmp (so it is now on the root file system), and now the `pkg` command runs fine.

Now I should just find some time and energy to do something productive with the RPi3.


----------



## balanga (May 28, 2017)

I've increased /tmp and managed to install mc() so I already feel at home .

Now looking for something to do with my RPi...


----------



## ralphbsz (May 29, 2017)

Hook up a button and an LED.  Then do something fun: Use the button as a (very small) percussion instrument, try to guess the rhythm (cha-cha, valse, funeral march, tango, ...), and play appropriate music in rhythm with the button (you can use canned mp3 files, and I'm sure there are downloadable tools to speed them up and slow them down).  Use the LED as a psychedelic light source for mood (think "disco").  Extra points of you manage to do ritardando and accelerando.

P.S. Do I need to mention that I'm not being completely serious?  The partly serious part: I think it would be much fun to control real-world entities.  Matter-of-fact, if I weren't so busy with drywall and painting for my new garden shed (which will house our water pumps), I would be prototyping interfaces between the RPi3 and pressure sensors, water level sensors, pumps, and the well.


----------



## balanga (May 29, 2017)

Hooking up a switch or a LED is what I'd like to do next but I don't know how. Any basic instructions (for FreeBSD) would be useful..

My longer term aim is to be able to switch on the watering system in the garden when it's dry, or setup a remote weather station, albeit at the bottom of the garden.


----------



## ralphbsz (May 29, 2017)

That's one of the enigmas of using the RPi: The instructions for LEDs and switches are completely OS-independent: Get a connector, get a piece of PC board (I personally like the pre-made proto boards, Adafruit and others sell them), get a few resistors and a voltmeter, and most importantly a soldering iron.  If you have no experience with soldering, diodes, and a voltmeter, then expect that the learning process will leave a few corpses behind (by the way, this is why using the $5 Pi zero is a good idea: it doesn't hurt the feelings so much if it goes in the trash bin).  BUT: None of this will be found on FreeBSD-specific web pages.  Matter-of-fact, when searching for FreeBSD-specific information, and generic Raspberry Pi information (like the pinout of the 40-pin connector), I saw that the Pi foundation has lots of nice tutorials on stuff like that, you just have to translate the commands from RaspBian.

For watering system, analog sensing (for example of soil humidity) and weather interfacing: If you want to do all of that yourself (from a Pi, chips, and soldering iron), there is lots of learning and work to do.

For the FreeBSD-specific part: I added an LED to GPIO 17 via 220ohm to +3.3V, and a pushbutton to GPIO 27 (via a 1K safety resistor to ground with a 10K pullup to +3.3V), and here is all the "coding" I had to do (it works perfectly from the command line):

```
# gpioctl -c 17 OUT
# gpioctl -c 27 IN # That's the default anyway
# gpioctl 27 # Returns 1 if button not pushed, 0 if button pushed
# gpioctl 17 1 # LED off
# gpioctl 17 0 # LED on
```

But: The gap between a switch and an LED, and a control system that can handle a half-dozen sensors and three industrial-size pumps (my case), or a weather station with sprinkler controller (your case) is gigantic.  Lots of evenings and weekends of work.


----------



## balanga (May 29, 2017)

I have a PiFace Digital interface and would love some sample code to get started just switching on a light...

I appreciate the gap between this and and an automated sprinkler is immense and am prepared for lots of trial and error over a few months trying to get it to work. 

However using a soldering iron is beyond my scope of confidence/ability.


----------



## asteriskRoss (Jun 5, 2017)

balanga said:


> What type/size are you using?


Apologies for the slow reply. The card isn't anything special: SanDisk SDHC 4GB Class 4. I bought it a while back so it may have been superseded.


----------

