Skip to content

Must be good. Brickbat quotient is quite high

It’s like the Upstart and Systemd upgrades to the Linux init system. Boy, did that get some people upset. This time around its Snap, Flatpack, and other efforts to solve application compatibility and security issues. (see 2daygeek).

The thing is, software applications often depend upon common libraries of functions. Some of these libraries are provided by the system, some are provided by development environments and some by library builders. These function libraries change as bugs are fixed, security holes plugged, and enhancements made. The fixes and changes can sometimes surprise applications that use the library to misbehave. Different expectations about the system and functions available can create conflicts that make support and operation of the software difficult.

Another problem is that some applications get into system areas where they can do damage. This can be intentional, like in malware, or unintentional due to error or oversight. The term sandbox was applied to techniques to limit this sort of problem. CPU designers have been adding sandbox capabilities at the lowest levels in terms of memory protections and user privilege levels and thread isolation. Systems have picked up on these new CPU capabilities and provided such things as containers and virtual machines and other security mechanisms (see nixCraft).

Like Ubuntu coming up with Upstart and then folding over to Systemd as that became accepted as a solution to startup dependencies and other issues, Ubuntu developed Snaps to solve application issues. Fedora is putting its efforts behind Flatpack. And the bigots and trolls are out in force, again, throwing brickbats. There seems to be a larger ‘hate Shuttleworth and Ubuntu’ contingent in this mob but that may be due to the target being easier to personify and identify. Whatever. The brickbat quotient tells you it is an important issue and effective solutions are starting to appear.

Chrome apps: serial to display platform agnostic

Lucandentella describes a Chrome App that displays serial port information.

During the development of my electronic projects, I sometimes need to develop a graphical user interface (GUI) that talks using serial communication with the devices I create.

In the past, I usually chose to develop those interfaces in C# and using the .Net Framework; framework which allows a rapid development, offers great ways to customize the interface (for example the ability to use custom fonts as in the GUI for RTCSetup) and makes easy to access all the different graphical elements of the operating system

Today I’m going to describe you a way to develop cross-platform applications with the same techniques you use to develop web sites and without requiring external libraries: the Chrome Apps.

In this tutorial I described how you can, using the Chrome Apps, easily develop real cross-platform applications. In this way, you can add a rich user interface to your electronic projects and it will run on Windows, Linux or MacOS (and with an experimental library also on Android and MacOS).

When investigating Kodi on the Raspberry Pi run on LibreELEC, I found that there is app for that, of course. But Kodi also supports control via a web interface. That means I could either install an app on my Android tablet or I could just run the browser to tell Kodi what I wanted it to do. Why install yet another app when I could do the same thing with an app that is already there?

Java was thinking about it but HTML 5 and the other modern web technologies are making a lot of progress towards the standard UI. Lucandentella’s example shows the possibilities.

Computers, microcontrollers, cost points, features

I see Seeed Studio has a special on a Raspberry Pi 7″ Touchscreen Display for $60. Add $40 for the SBC and another $10 for a case and memory and on down the line and you’ve got to wonder about cost effectiveness. You can get a ready to run 7″ tablet for under $50 and Amazon has several to choose from. The tablet probably even has a real time clock and a battery and charger and all the Android apps (the Raspberry doesn’t). So what do you need?

The Raspberry has an ethernet port, four USB ports, HDMI, and the GPIO pins and support for low level protocols such as I2C and SPI.

The Ethernet and USB are sometimes panned on the Raspberry because they are all on a common hub. You could put a hub on a tablet that has OTG USB support and do the same thing. HDMI output stands out, though, as it provides a special capability. As for the low level stuff, consider the micro controller that Geoff uses for his ‘Standard’ Micromite that only requires a $5 chip (Microchip PIC32MX170F256B) and a single capacitor.

Nineteen input/output pins are available on the 28-pin chip and 33 I/O pins on the 44-pin chip. These can be independently configured as digital input or output, analog input, frequency or period measurement and counting. Ten or more of the pins can be used to measure voltages and another seven or more can be used to interface with 5V systems.

Input/Output functions in MMBasic will generate pulses (both positive and negative going) that will run in the background while the program is running. Other functions include timing (with 1 mS resolution), BASIC interrupts generated on any change on an input pin and an internal real time clock.

A comprehensive range of communications protocols are implemented including I2C, asynchronous serial, RS232, IEEE 485, SPI and 1-Wire. These can be used to communicate with many sensors (temperature, humidity, acceleration, etc) as well as for sending data to test equipment.

Built in commands to directly interface special devices such as infrared remote controls, the DS18B20 temperature sensor, LCD display modules, battery backed clock, distance sensors, numeric keypads and more.

Up to five PWM or SERVO outputs can be used to create various sounds, control servos or generate program controlled voltages for driving equipment that uses an analogue input (eg, motor controllers).

Special embedded controller features in MMBasic allow the clock speed to be varied to balance power consumption and speed. The CPU can also be put to sleep with a standby current of just 90µA. While in sleep the program state and all variables are preserved. A watchdog feature will monitor the running program and can be used to restart the processor if the program fails with an error or is stuck in a loop.

With a serial to USB converter, you should be able to talk to nearly any modern computing device. Or you could talk to an ESP8266 for about the same cost and use WiFi to communicate without wires. You also need to keep in mind that blowing up a $5 chip because of pin mis-wiring  is a lot less painful than blowing up a $35 SBC.

The development environment is a consideration as well. Android has a free IDE with a lot of support and those two factors are what make the Arduino and Rasberry so popular.

Ease of development can also be a minus. Even Geoff is going towards plug and chug on touch screen displays. Learning (the hard way) about how these things work is a part of the cost benefit analysis and what learning benefit is there if you don’t have to get down and dirty with the communication protocols?

It gets tough. You don’t get these things because you know what to do with them, you get them to figure out what you can do with them. But then, how do choose which one to play with? Fortunately, the financial risc isn’t that high. Get a microcontroller, Arduino or Picaxe or Micromite for the low level and sensing stuff. Get an SBC like the Raspberry as an aggregation and pre-processing device. Then add an Android tablet for display and control. Or maybe get an old old PC like say ca 1980 and hack with it.   

Never been better for the hobbyist.

Raspberries

Recently, Amazon had a Vilros ultimate Rasperry Pi 3 kit on sale. That was an opportunity. The kit included a Pi SBC, case, power supply, NOOB on a 32 GB card, HDMI cable, heat sinks, and some breakout and prototyping items.

I don’t see this SBC as a hardware hacker’s best choice or even an educator’s best choice. LibreELEC is a very good example of its capabilities. This is a minimal customized embedded effort with a focus on running KODI so the SBC serves as a media center. That utilizes the graphics capabilities, the CPU capabilities for running a complete modern OS, and the built in peripherals to run a display and USB connected peripherals. Where it runs short is in power control and codec licensing (a purchase option for MPEG-2 DVD is available). A key benefit is that the NOOB easily gets you from out of the box to a turnkey media player with minimal hassle.

The SBC shines when it comes to USB or networking to talk to peripherals and supporting an interactive user interface. There are a few GPIO pins available that can be convenient but they are 3.3v digital only. If you want to get into control and sensing applications, you’d probably do a lot better with a microcontroller that has a whole zoo of built in capabilities.

For education, there is the Arduino and PICAXE but those are getting a bit old. Geoff’s Micromite is looking good for this market. Geoff put together Microsoft BASIC compatible firmware for a PIC 32 bit microcontroller. “You can use the Micromite as the intelligence inside any project that requires a medium speed microcontroller but without the hassle of programming in a complex language.” That is a very simple computer circuit with one chip and one capacitor running off a 3.3v supply. The firmware is open source and the project appears to be a good introduction into the world of PIC microcontrollers and PIC has a decent, free development environment to take off on this.

Of course, the Raspberry Pi Zero is a $5 full fledged SBC (see Adafruit) and there is a large pile of < $50 computers and development boards to play with. The ESP8266 is in the <$10 list to provide full WiFi connectivity with Arduino style IDE’s available to make IoT thingies that don’t need much else except a battery. So many choices and so cheap!

And if you can’t figure out some project to wire up and program, take a gander through Ebay, Seeed Studio, or some of the other hobbyist collections for kits or modules to do all sorts of things. The electronics hobby is not what it used to be. Now you can implement many things that were near impossible in years past, do so without having to invest much of either money or knowledge, and choose your own level of involvement from plug and chug down to designing your own circuits and building circuit boards and everything else.

Finally, Weather service upgrades from RTTY

Anthony Watts reports: NOAA/NWS to stop ‘yelling’ at the public in their forecasts.

New forecast software is allowing the agency to break out of the days when weather reports were sent by “the wire” over teleprinters, which were basically typewriters hooked up to telephone lines. Teleprinters only allowed the use of upper-case letters, and while the hardware and software used for weather forecasting has advanced over the last century, this holdover was carried into modern times since some customers still used old equipment.

Better late than never, but the slow change was not for lack of trying. The National Weather Service has proposed to use mixed-case letters several times since the 1990s, when widespread use of the Internet and email made teletype obsolete. In fact, in web speak, use of capital letters became synonymous with angry shouting. However, it took the next 20 years or so for users of Weather Service products to phase out the last of the old equipment that would only recognize teletype.

Finally! About time!

I note that the 1Weather app and the NWS Forecast Discussion on the web have both gone to mixed case. That is much easier to read.

An appeal to Linux developers: BASH in Windows

The latest news about how Microsoft is going to cater to Linux developers is big news. There is a lot of the computer world hidden in that idea. Peter Bright describes Why Microsoft needed to make Windows run Linux softwareAnd how it could leapfrog Apple as the dev platform of choice.” Microsoft has always been after schools for its platform with the idea that familiarity by students would lead to future development for its platforms. Times have changed and it has been losing ground so now it is time to reset.

Microsoft is positioning WSL strictly as a tool for developers, with a particular view to supporting Web developers and the open source software stacks that they depend on. Many developers are very familiar with the bash shell, with building software using make and gcc, and editing text in vi or emacs. WSL will give these developers versions of these tools that are equal in just about every regard to the ones you get on Linux, because they’ll be the ones you get on Linux running unmodified on Windows.

With that developer focus, Microsoft isn’t supporting WSL as a deployment platform. It might be possible to run, for example, the Apache Web server under WSL, and it might even be useful to do so for development, but the intent is not that applications would ever be run in production with this configuration.

it’s unlikely that the company would make such a move just to provide a few creature comforts to developers. The need goes deeper than that.

Wind the clock back 15 years and Windows was the only serious platform for software developers. Linux was already an important consideration for servers, but on the desktop was even less of a concern than it is today, reserved only for the most hardcore fans. OS X was in its infancy, and only ran on weird, expensive, underpowered PowerPC hardware. This made Windows the development platform of choice by default. There simply wasn’t any good alternative.

But things don’t work that way any more.

Windows certainly hasn’t disappeared completely from view, but it’s no longer the essential, must-have platform that it once was. Why not? Because those two non-contenders in 2000 are more or less viable today. Linux for various reasons still may not be the most comfortable desktop platform (especially for anyone wanting to use it on a brand-new laptop), but it’s much more livable than it used to be. And OS X, thanks to a combination of the switch to x86 and Apple’s fine hardware design, has become an appealing option for a great many developers.

Running Android on Windows is a part of this as well. That is not only an incentive to support a Linux API but it also an entire ecosystem including developers, retailers, and users. You can see the influence of this in Windows 10 with its app store and other user experience changes from earlier versions of Windows. This latest effort is trying to keep up on the development side. The market is speaking. The behemoths are listening. This should be better for all of us.

RTL SDR reference

The Hobbyist’s Guide to the RTL-SDR: Really Cheap Software Defined Radio (affiliate link) by Mr. Carl Laufer is a compendium and compilation that makes it a good reference and an eye opener about what you can do with the inexpensive TV dongles based on the RTL2832U for modern short wave listening.

One aspect is software and Carl describes what is available and how to get it up and running. This provides an insight into the shifts in Amateur Radio from building simple receivers and transmitters out of discrete parts to experimentation with hardware modules driven by software development.

Another aspect is learning about how the radio spectrum above HF is actually used. There are many services from aircraft beacons to monitoring systems that can be heard and decoded. The dictionary of such services in Carl’s book describes these services, how they are used, and how to listen in with a RTL2832 and appropriate SDR applications.

At 272 pages, this book has a lot of meat and very little fluff. It is most definitely worth consideration as a convenient place to find answers about using the RTL2832 as well as about what is going on in the world in the spectrum between HF and WiFi.

The very ontology of song

Decomposing music separates it into three basic components: rhythm, harmony and melody. Rhythm can live by itself. It inhabits the time domain. Harmony can also live by itself. It inhabits the frequency domain. Melody is a glue that holds harmony and rhythm together. Ed Driscoll at Insta-Pundit cited David Solway’s The Mystery of Melody to bring this to mind. Solway gets into the problems in defining melody and how he sees its use in popular music as a reflection of culture.

The issue is how we hear melody as a unique, modular configuration of sounds which are tangible and yet incorporeal, as if inhabiting an ethereal region between the neural and the spectral and eliciting a vast range of sympathetic response.

Here I’m preoccupied with something no less or even more fundamental, cryptic, occult, and maybe unfathomable; namely, with the enigma of melody, that “something” which cannot be mastered.

To start with, there is plainly no way of knowing how melody originated; here we must rely on pure, unverifiable speculation.

Equally mysterious is the process of “inventing” or, better, “discovering” the elusive strains of a melody, guitar on one’s lap, pen and notepad on the table, gaze focused on the far distance.

By “melody,” I intend something other than “music”—which is a composite phenomenon consisting of combinations of tones vocal and instrumental, including rhythm, melody and harmony

Melody may have its origin in human nature or in the realm of spirit, but, as we’ve noted, it is inflected differently in different cultures. Tonal systems vary dramatically; yet, though all these systems will qualify as music, not all can be described as melodic.

I am by no means suggesting that other musical traditions are not valid and authoritative and beautiful in themselves, but I am proposing that melody per se, in its richest and most memorable form, was detected—and perfected—by the Western sensibility.

All this discussion notwithstanding, I still can’t say what melody is. I do know that melody is something that can be hummed, and that I can’t hum plainchant or rap or Ravi Shankar. Hummability is the basic litmus test of melody.

A melody is something that can get trapped in your head and take some effort to get it out of your thinking. An insurance company has used this concept in their advertising to try to stick their jingle in your head. That is a characteristic of a good melody. It is so easily remembered that it can be difficult to shove it into the background of your mind.

Solway provides an interesting take. Melody is an indicator of Western Culture that is visible (audible?) and mysterious. The question that brings to my mind is whether any other culture has studied music and played with music from a logical and rational basis, even a mathematical basis, like Western Culture has. The Baroque composers illustrate this. ‘FakeBooks’ illustrate this with their massive collections of melodies with their bare hints of rhythm and harmony. As an example, I arranged the happy birthday song in close four part harmony for a studio band once according to basic rules of musicology. It might have been interesting to hear the result but the effort was dismissed on the grounds that a baroque approach by a jazz band to a simple tune just wasn’t what the market was after to celebrate some party goer’s birthday.

Melody as Solway is discussing is indeed a critical indicator of culture. His discussion is one that influences how one listens. That is one way to learn.

The Amp Hours confusion

When it comes to batteries, the energy capacity is often given as Amp-Hours. For smaller batteries like those used in portable devices, this often shows up as milliamp-hours. This can be misleading because a proper measure of energy needs volts as well as amps over time. An example is the auxiliary batteries available for charging cell phones. Here’s an example: iXCC 8000mAh Compact Power Bank – Portable External Backup Charger Battery Pack for Smartphones, MP3 Players, Tablets and Other Devices(Silver) that Amazon had as a lightening deal until 2/22 at 1300z.

This example does specify “8000 mAh external Li-polymer rechargeable battery” which means that the voltage in question is 3.7 nominal so the actual energy capacity is 8*3.7 or 29.6 watt hours. A low end phone has an internal battery listed as 2100 mAh or 8.0 Wh. That means this particular power bank has enough energy to recharge the cell phone about 3 times before it is depleted.

What confuses things? Both the power bank and the cell phone charge at 5 volts. If you use the rather unusual watt hours rather than the mAh there’s no confusion but the power bank is rated in mAh and you have to look close to realize that that rating is for an assumed battery voltage that is 26% less than the voltage the power bank provides for charging.

This measurement confusion can get even more interesting when talking about battery banks or about batteries that have significant voltage changes over their useful discharge cycle. This can complicate the analysis about replacing lead acid batteries with lithium batteries in a car or RV, for instance. Lead acid cells are nominally 2 volts. Lithium cells are 3.7v unless they are LiFePO4 which operate at 3.2v. Then you can look at the discharge curves and get an insight into why calculus and integration might be useful ….

Fun stuff. The lesson is to use proper units and don’t confuse current, power, and energy.

Gravity waves. 5 Sigma results

The announcement indicates that gravity waves have been detected. The source of the waves is the collision of two black holes each with a mass of tens of times that of the sun. In the collision, an amount of mass was lost equivalent to several times that of the sun. This loss of mass was due to it being converted to energy that was expressed as gravity waves. It took an interferometer capable of measuring disturbances smaller than the nucleus of an atom to detect these gravity waves.

At the Wolfram blog, Jason Grigsby provides some background on the detection of gravity waves by LIGO.

Earlier today at a press conference held at the National Science Foundation headquarters in Washington, DC, it was announced that the Laser Interferometer Gravitational-Wave Observatory (LIGO) confirmed the first detection of a gravitational wave.

A hundred years ago, Einstein’s theory of general relativity predicted the existence of gravitational waves—little ripples in spacetime that carry energy and information. But it has taken a century of technological progress to provide us the practical means to confirm the theory. LIGO’s historic discovery has not just confirmed Einstein’s theory—it also provides us with a first peek into an entirely new way of conducting astronomy.

Given the vanishingly small earthly effects of gravitational waves, it takes some of the most energetic events in the universe to generate gravitational waves that are detectable by LIGO. The most likely to be detected are generated by binary black holes with a total mass of about 10–100 times that of the Sun. Indeed, we heard at the LIGO press conference earlier today that the detected waves were from the merger of two black holes of approximately 65 solar masses total. During the course of spiraling together and merging, three solar masses’ worth of energy were radiated out in a fraction of a second. The actual merger of these two black holes happened approximately 1.3 billion light years away, meaning that these two black holes merged before multicellular life came about on Earth.

That’s two major confirmations of theory in recent years and both get into fundamental questions about the structure of matter. Gravity and the Higgs Boson both star in string theories that try to combine everything we know into a unified model.