hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[20150717] Making my RPI serial console work, or: fixing a hardware problem in software
Some time ago I get a Raspberry Pi, but never really got it working: I don't have a HDMI display, and wanted to use the serial console. Unfortunately the "official" RPI-serial-to-USB cable had an annoying effect for me: while I saw output just fine, I wasn't able to type anything! Funny enough, this was not only in NetBSD but also Debian. Which took the blame from NetBSD :) Picture 1 shows the cabling.

So the blame was on the RPI-USB-to-serial cable, and I looked into making my own. I have a standard USB-to-serial adapter, but that one cannot be connected pin-by-pin to the RPI, as they use different voltage levels. While the "standard" serial UART protocol (RS-323) encodes 0s and 1s as 5V and -5V, the RPI uses TTL voltage between 0 and 3.3V - a simple 1:1 connection sounds like a bad idea. Converters like the MAX3232 are available: it connects the TX and RX lines and adjusts the voltage levels. To operate, power and ground are provided by the RPI. After frobbing this together (see picture 2) I found out that - surprise - the problem was not in the cable either, as my home-made cable also did not work for input, only for output.

After some detour (frobbing the image-build process to make me an image that not only has working DHCP and SSH, but that actually let's me log in), I got the crucial hint what was going on:

Having lines for sending and receiving data is nice, but what if one end's receiver is full and wants to signal that? This is called "flow control", and apparently with no lines for that, hardware flow control is not an option. In theory there is a software solution (sending XON/XOFF bytes), which requires equal settings on both sides. Apparently the RPI doesn't do that either, and with the default settings on my NetBSD host to wait for an XON before sending data, things didn't match up - no XON from the RPI, no data going to it. Plain and simple - if you know what's going on.

The fix was easy, and thanks go to Jean-Baka Domelevo Entfellner for the hint: disable flow control in my terminal program (kermit). So with a simple "set flow none", things work like a charm now. Voila, another hardware problem fixed in software! :)

How to look at serial interface parameters from NetBSD? Use the stty(1) command. Here's the default output for my USB-to-serial interface attached to ttyU0:

# stty -f /dev/ttyU0
ispeed 0 baud; ospeed 9600 baud;
lflags: echoe echoke echoctl
oflags: onocr onlret
cflags: cs8 -parenb
The difference is obvious when running the same command while kermit runs with proper settings in a different window:
# stty -f /dev/ttyU0
speed 115200 baud;
lflags: -icanon -isig -iexten -echo echoe echoke echoctl
iflags: -icrnl -ixon -ixany ignbrk ignpar
oflags: -opost onocr onlret
cflags: cs8 -parenb clocal
Not only is the speed different, but most important "-ixon" tells the interface to not wait for an XON on input (iflags) before transmitting data.

For reference sake, here is my .kermitrc that I use:

# cat .kermrc
# Raspberry PI
set carrier-watch off
set line /dev/ttyU0
set flow none                   # disable hardware flow control
set speed 115200
#set speed 9600

#connect
Picture 1: The standard RPI-USB-to-serial cable (click to enlarge)
Picture 2: My own USB-to-serial adapter using a MAX3232 chip (click to enlarge)


[Tags: , , , , , , , , , ]


[20130203] Updating hubertf's NetBSD blog for the Social Web (AKA Facebook)
Postings on the front page of this blog as well as individual articles had a "Slashdot it" link on the bottom for quite some time. With noone noticing that this wasn't working for some time, apparently. To fix the situation, and bring this blog a bit closer to the Social Web, I've removed the Slashdot-link, and added some Facebook buttons.

I'm aware that this may cause some distress, and I'm curious to hear your opinion - mail me at the above address (or drop me a line on FB :-).

Also: FB is the only of those apps that I really use these days - I do not currently have plans to add any others. Again, if I'm flooded with pleas, this can be changed. It may actually save me from logging e.g. into Google+ and Twitter to share things there. What do you think?

[Tags: , ]



[20121227] Blog news: software updated
Just FYI, I've upgraded the blog software to blosxom 2.1.2. No bits were harmed in the upgrade process, if you find anything that doesn't work as expected please let me know!

P.S.: Any volunteers to put blosxom into pkgsrc?

[Tags: , ]



[20091107] On the difference between "data" and "information"

Thanks xkcd, from the information scientist inside me!

[Tags: , , , ]



[20090503] Concluding the Virtual Unix Lab
I've finished my PhD thesis some time ago, and as the system described in it is heavily based on NetBSD, I feel it's relevant for mentioning here. The full title is ``System Administration Training in the Virtual Unix Lab -- An e-learning system with diagnosis via a domain specific language as base for an architecture for tutorial assistance and user adaption''. The book was published in Jan 2009 by Shaker, Germany as ISBN 978-3-8322-7874-8, and it is also available for online purchase and if you look around a bit on my VUlab page, you will find a permitted local copy for downloading as well.

Here's the backmatter of the book: ``Practical exercises in system administration can render a machine unusable, and restoring the machine requires manpower which is often scarce. As a result, there is a lack of dedicated exercise machines which can be used in the education of system administration. The Virtual Unix Laboratory is an interactive e-learning system that provides a solution for this situation. After sign-up, machines are installed on which students can do their exercises with full "root"-access. At the end of the exercise, the system checks which parts were done correctly, and gives feedback.

The first part of this book describes the goals of the Virtual Unix Lab and related works, followed by observations about education of system administration. In the second part, the Verification Unit Domain Specific Language (VUDSL) is defined, and diagnosis of the Virtual Unix Lab exercise results and feedback to the user are realized with it. An evaluation of the system shows interesting results and identify areas for further improvement. The third part explains how tutoring and user adaption can be realized. An architecture for a tutoring component for the Virtual Unix Lab is described, and user adaption is based on the user model built by the tutoring component.''

The system was implemented on a machine running NetBSD, training systems available were NetBSD/sparc and Solaris/sparc. Interesting technical points where configuring access to the lab machines by enabling IPfilter rules from the user's webbrowser, and disabling the rules by an at(1) job. Also, the system to install the lab clients used disk images and NetBSD in netbooted environment.

I hope that's enough of a reason to post this here.
</commercial block>

[Tags: , , , , ]



[20080908] !NetBSD: Comics for sale (mostly german, some english+japanese)
Spam: I've got a bunch of (mostly german-language) comics that I'd like to get rid of. For more information, see this link.

[Tags: ]


[20080904] Moved, virtually
FWIW, I've moved my whole website, including this blog, to a new hosting site. I hope everything's still up and running, but if not, let me know.

[Tags: ]


[20080815] !NetBSD: Books for sale (german language, no computer stuff)
Spam: I've got a bunch of german-language books that I'd like to get rid of. Novels, some comics/mangas, no computer-stuff. For more information, click here.

[Tags: ]


[20080801] Offline
I'll be AFK for the next ~10 days. Don't expect any updates, even as there are some pending.

[Tags: ]


[20071211] Technical reports from the Virtual Unix Lab project
The Virtual Unix Lab is a training system that offers practical exercises for system administration, allowing students to perform exercises for NIS and NFS in a client-server environment. A key item is the feedback provided to the student after the exercises, so he can learn from his mistakes. Operating systems involved in the exercises are NetBSD and Solaris, the system itself is implemented on a PC running NetBSD plus two Sun SPARCstations running either NetBSD or Solaris, depending on the exericse setup.

The system is the core part of my PhD-thesis (to come :), and I've published three technical reports that describe a number of aspects of the systems in lengthy details. Those interested can find them here:

More information about the Virtual Unix Project, including presentations, other publications and screenshots can be found on the Homepage of the Virtual Unix Lab.

An introduction and overview of the system's operation can be found in this EuroBSDCon paper.

The thesis will assume the version of the lab described above, including the domain specific languages techniques, diagnosis and feedback, and describe how to implement tutoring and user adaption on top of that.

[Tags: , ]



Previous 10 entries

Tags: , 2bsd, 3com, 501c3, 64bit, acl, acls, acm, acorn, acpi, acpitz, adobe, Advocacy, advocacy, advogato, aes, afs, aiglx, aio, airport, alereon, alex, alix, alpha, altq, am64t, amazon, amd64, anatomy, ansible, apache, apm, apple, arkeia, arla, arm, art, Article, Articles, ascii, asiabsdcon, aslr, asterisk, asus, atf, ath, atheros, atmel, audio, audiocodes, autoconf, avocent, avr32, aws, axigen, azure, backup, balloon, banners, basename, bash, bc, beaglebone, benchmark, bigip, bind, blackmouse, bldgblog, blog, blogs, blosxom, bluetooth, board, bonjour, books, boot, boot-z, bootprops, bozohttpd, bs2000, bsd, bsdca, bsdcan, bsdcertification, bsdcg, bsdforen, bsdfreak, bsdmac, bsdmagazine, bsdnexus, bsdnow, bsdstats, bsdtalk, bsdtracker, bug, build.sh, busybox, buttons, bzip, c-jump, c99, cafepress, calendar, callweaver, camera, candy, capabilities, card, carp, cars, cauldron, ccc, ccd, cd, cddl, cdrom, cdrtools, cebit, centrino, cephes, cert, certification, cfs, cgd, cgf, checkpointing, china, christos, cisco, cloud, clt, cobalt, coccinelle, codian, colossus, common-criteria, community, compat, compiz, compsci, concept04, config, console, contest, copyright, core, cortina, coverity, cpu, cradlepoint, cray, crosscompile, crunchgen, cryptography, csh, cu, cuneiform, curses, curtain, cuwin, cvs, cvs-digest, cvsup, cygwin, daemon, daemonforums, daimer, danger, darwin, data, date, dd, debian, debugging, dell, desktop, devd, devfs, devotionalia, df, dfd_keeper, dhcp, dhcpcd, dhcpd, dhs, diezeit, digest, digests, dilbert, dirhash, disklabel, distcc, dmesg, Docs, Documentation, donations, draco, dracopkg, dragonflybsd, dreamcast, dri, driver, drivers, drm, dsl, dst, dtrace, dvb, ec2, eclipse, eeepc, eeepca, ehci, ehsm, eifel, elf, em64t, Embedded, embedded, emips, emulate, encoding, envsys, eol, espresso, etcupdate, etherip, euca2ools, eucalyptus, eurobsdcon, eurosys, Events, exascale, ext3, f5, facebook, falken, fan, faq, fatbinary, features, fefe, ffs, filesystem, fileysstem, firefox, firewire, fireworks, flag, flash, flashsucks, flickr, flyer, fmslabs, force10, fortunes, fosdem, fpga, freebsd, freedarwin, freescale, freex, freshbsd, friendlyAam, friendlyarm, fritzbox, froscamp, fsck, fss, fstat, ftp, ftpd, fujitsu, fun, fundraising, funds, funny, fuse, fusion, g4u, g5, galaxy, games, gcc, gdb, gentoo, geode, getty, gimstix, git, gnome, google, google-soc, googlecomputeengine, gpio, gpl, gprs, gracetech, gre, groff, groupwise, growfs, grub, gumstix, guug, gzip, hackathon, hackbench, hal, hanoi, happabsd, hardware, Hardware, haze, hdaudio, heat, heimdal, hf6to4, hfblog, hfs, history, hosting, hotplug, hp, hp700, hpcarm, hpcsh, hpux, html, httpd, hubertf, hurd, i18n, i386, i386pkg, ia64, ian, ibm, ids, ieee, ifwatchd, igd, iij, image, images, imx233, imx7, information, init, initrd, install, intel, interix, internet2, interview, interviews, io, ioccc, iostat, ipbt, ipfilter, ipmi, ipplug, ipsec, ipv6, irbsd, irc, irix, iscsi, isdn, iso, isp, itojun, jail, jails, japanese, java, javascript, jetson, jibbed, jihbed, jobs, jokes, journaling, kame, kauth, kde, kerberos, kergis, kernel, keyboardcolemak, kirkwood, kitt, kmod, kolab, kvm, kylin, l10n, landisk, laptop, laptops, law, ld.so, ldap, lehmanns, lenovo, lfs, libc, license, licensing, linkedin, links, linksys, linux, linuxtag, live-cd, lkm, localtime, locate.updatedb, logfile, logging, logo, logos, lom, lte, lvm, m68k, macmini, macppc, macromedia, magicmouse, mahesha, mail, makefs, malo, mame, manpages, marvell, matlab, maus, max3232, mbr95, mbuf, mca, mdns, mediant, mediapack, meetbsd, mercedesbenz, mercurial, mesh, meshcube, mfs, mhonarc, microkernel, microsoft, midi, mini2440, miniroot, minix, mips, mirbsd, missile, mit, mixer, mobile-ip, modula3, modules, money, mouse, mp3, mpls, mprotect, mtftp, mult, multics, multilib, multimedia, music, mysql, named, nas, nasa, nat, ncode, ndis, nec, nemo, neo1973, netbook, netboot, netbsd, netbsd.se, nethack, nethence, netksb, netstat, netwalker, networking, neutrino, nforce, nfs, nis, npf, npwr, nroff, nslu2, nspluginwrapper, ntfs-3f, ntp, nullfs, numa, nvi, nvidia, nycbsdcon, office, ofppc, ohloh, olimex, olinuxino, olpc, onetbsd, openat, openbgpd, openblocks, openbsd, opencrypto, opendarwin, opengrok, openmoko, openoffice, openpam, openrisk, opensolaris, openssl, or1k, oracle, oreilly, oscon, osf1, osjb, paas, packages, pad, pae, pam, pan, panasonic, parallels, pascal, patch, patents, pax, paypal, pc532, pc98, pcc, pci, pdf, pegasos, penguin, performance, pexpect, pf, pfsync, pgx32, php, pie, pike, pinderkent, pkg_install, pkg_select, pkgin, pkglint, pkgmanager, pkgsrc, pkgsrc.se, pkgsrcCon, pkgsrccon, Platforms, plathome, pleiades, pocketsan, podcast, pofacs, politics, polls, polybsd, portability, posix, postinstall, power3, powernow, powerpc, powerpf, pppoe, precedence, preemption, prep, presentations, prezi, Products, products, proplib, protectdrive, proxy, ps, ps3, psp, psrset, pthread, ptp, ptyfs, Publications, puffs, puredarwin, pxe, qemu, qnx, qos, qt, quality-management, quine, quote, quotes, r-project, ra5370, radio, radiotap, raid, raidframe, rants, raptor, raq, raspberrypi, rc.d, readahead, realtime, record, refuse, reiserfs, Release, Releases, releases, releng, reports, resize, restore, ricoh, rijndael, rip, riscos, rng, roadmap, robopkg, robot, robots, roff, rootserver, rotfl, rox, rs323, rs6k, rss, ruby, rump, rzip, sa, safenet, san, savin, sbsd, scampi, scheduler, scheduling, schmonz, sco, screen, script, sdf, sdtemp, secmodel, Security, security, sed, segvguard, seil, sendmail, serial, serveraptor, sfu, sge, sgi, sgimips, sh, sha2, shark, sharp, shisa, shutdown, sidekick, size, slackware, slashdot, slides, slit, smbus, smp, sockstat, soekris, softdep, softlayer, software, solaris, sony, sound, source, source-changes, spanish, sparc, sparc64, spider, spreadshirt, spz, squid, ssh, sshfs, ssp, statistics, stereostream, stickers, stty, studybsd, subfile, sudbury, sudo, summit, sun, sun2, sun3, sunfire, sunpci, support, sus, suse, sushi, susv3, svn, swcrypto, symlinks, sysbench, sysctl, sysinst, sysjail, syslog, syspkg, systat, systrace, sysupdate, t-shirt, tabs, talks, tanenbaum, tape, tcp, tcp/ip, tcpdrop, tcpmux, tcsh, teamasa, tegra, teredo, termcap, terminfo, testdrive, testing, tetris, tex, TeXlive, thecus, theopengroup, thin-client, thinkgeek, thorpej, threads, time, time_t, timecounters, tip, tk1, tme, tmp, tmpfs, tnf, toaster, todo, toolchain, top, torvalds, toshiba, touchpanel, training, translation, tso, tty, ttyrec, tulip, tun, tuning, uboot, ucom, udf, ufs, ukfs, ums, unetbootin, unicos, unix, updating, upnp, uptime, usb, usenix, useradd, userconf, userfriendly, usermode, usl, utc, utf8, uucp, uvc, uvm, valgrind, vax, vcfe, vcr, veriexec, vesa, video, videos, virtex, virtualization, vm, vmware, vnd, vobb, voip, voltalinux, vpn, vpnc, vulab, w-zero3, wallpaper, wapbl, wargames, wasabi, webcam, webfwlog, wedges, wgt624v3, wiki, willcom, wimax, window, windows, winmodem, wireless, wizd, wlan, wordle, wpa, wscons, wstablet, X, x.org, x11, x2apic, xbox, xcast, xen, Xen, xfree, xfs, xgalaxy, xilinx, xkcd, xlockmore, xmms, xmp, xorg, xscale, youos, youtube, zaurus, zdump, zfs, zlib

'nuff. Grab the RSS-feed, index, or go back to my regular NetBSD page

Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 23206119
Copyright (c) Hubert Feyrer