On hackrf_transfer -c

Just a quick post on hackrf_transfer’s CW mode (-c). I’ve recently taken a HackRF One to a signal analyzer in order to make sense of how its DAC and gain values correspond to output power. In order to make use of this in GNU Radio one needs to know what byte sequence going into the DAC this corresponds to. Luckily this was easy to find out

hackrf_transfer.c has a line that reads “transfer->buffer[i] = amplitude;”, which implies the I/Q values sent are {amplitude,amplitude}. This means the actual samples have values of amplitude*(1+i), which is 40% larger or twice the amount of power than what you’d expect if say all the Qs were zero. You can see something similar to this in GNURadio if you feed a rectangular windowed FFT with “1″ vs “1+1j” constant sources (throttled). The former will have a 0 dBFS power while the latter will have +3 dBFS. Sort of a “turning it up to eleven” kind of thing :)

A recent commit to the git repository I have for this thing addresses this, such that you can use the same parameters for my CW transmitter as hackrf_transfer uses in its CW mode. Hopefully convenient!

Quick and dirty NFM transmitter in GNU Radio

Since getting my amateur radio license a while back I haven’t made much use of it, so yesterday I decided to try and do something about that. Unfortunately the handheld Yaesu VX-6E I ordered four weeks ago hasn’t arrived yet, so I decided to go an alternate route: figure out how to transmit narrowband FM using the HackRF One. The goal of the evening would be to get a conversation (QSO) going via the local VHF repeater on 145.650 MHz.

Some digging around on the Web showed that this is possible, but only as a transmit-only thing. Two-way communication is still tricky. GRC might not be a good enough tool for switching between TX and RX on a simplex device like the HackRF.

I eventually managed to cobble together a reasonable GNU Radio flow graph. After some poking around, with SA2KNG listening for my attempts at reaching the outside world, we figured the transmit power was too low, since even something very narrow like CW (Morse) was barely making it through the ~5 km distance from my location to Umedalen.

More digging around revealed that the RF amplifier on the HackRF may have some issues, and that there is an IF amplifier as well. Changing the IF amplifier setting from the default of +20 dB to the maximum of +47 dB made my signals go through quite well. It was time for the next part of my plan: activating the local repeater.

Activating the repeater simply means transmitting a 1750 Hz tone, which was relatively simple to extend the flow graph to do. The result was people on IRC noting that there’s a hell of a lot of beeping going on on the repeater. But I wasn’t hearing it. Why?

The answer turned out to be that the RTLSDR USB stick I was using for listening (via gqrx) was not picking up the repeater, but only my outgoing signal. A quickly constructed antenna (from a piece of TV coax) fixed that problem, and I was now able to repeat the experiment. I also added some courtesy features to the flow graph (push-to-talk, tone generator on/off). The end result was a successful (if noisy) QSO with SA2KNG. Success!

Picture time:

Transmitting antenna: 2 m/70 cm dipole

Receiving antenna: a 2 m dipole made from a piece of TV coax

Receiving antenna: 2 m dipole made from a piece of TV coax

SDRs. HackRF One and ezcap DVB-T FM DAB (RTLSDR)

SDRs. HackRF One and ezcap DVB-T FM DAB (RTLSDR)

GNU Radio notes

Some random notes about GNU Radio while I’m at it:

There doesn’t seem to be an easy way to implement a push-to-talk feature. For now I have hacked one together using a GUI slider that controls a “multiply const” box. The slider can only have the values “0″ or “1″, so it can be moved by tabbing to it in the UI and pressing the left/right arrow keys. I implemented a similar slider hack for enabling the 1750 Hz tone generator. Another problem is having to use an RTLSDR dongle for RX. I suspect this may be possible to fix by setting up a flow graph with both an RX and TX part, then enabling/disabling the relevant parts using some python code. The same python code could also read the keyboard, and maybe switch channels.

Here’s my code here in case someone else finds this interesting: nbfm-tx.grc. I’ve also attached a picture of the flow graph below:

GRC flow graph in picture form

GRC flow graph in picture form

Om nya systembolaget.se

Idag planerade jag att dra en sväng förbi vårat kära alkoholmonopol inför Urkult, och behövde få reda på öppettider. Eftersom vi lever i moderna tider använde jag då min webbläsare för att besöka http://www.systembolaget.se/, och fick då se att de gjort om sin webbsida rejält. Men, kära läsare, tänk min fasa när jag upptäckte att inga av sökfälten fungerar! Det visar sig att Systembolaget numera (?) kräver att man har JavaScript aktiverat i sin webbläsare för att kunna använda deras sida. Detta tycker jag är väldigt underligt när man är ett statligt bolag, och jag skickade därför följande via deras “tyck till”-formulär (som också kräver JS):

Underkänt. Sidan kräver JavaScript för att fungera och fungerar inte i t.ex lynx och därmed troligtvis ej heller med skärmläsare. Borde inte en del av Systembolagets uppdrag vara att vara tillgängliga för blinda personer? Samt att inte tvinga användare att köra främmande kod på sina datorer?

Nu i efterhand märker jag också att sidan laddar in Google Analytics, så jag hade även kunnat slänga in en rad om att det är underligt att man säljer data om svenskars dryckesvanor till amerikanska bolag. Nåväl.

Här hade jag tänkt ha ett litet utlägg om faran med att kräva att främmande kod körs för att webbsidor ska fungera, men det får bli en annan gång. Tills vidare rekommenderar jag att kika runt på langsec.org (Language-theoretic Security).

On resonant cavity thrusters

So the controversial EmDrive is making the rounds again, this time with a group of German experimentalists claiming to have measured a net thrust of 20 µN for 700 W of input power (link to paywalled paper). This post isn’t going to pass judgment on whether the effect is real or not, but rather whether it is actually of practical use given what has been claimed so far. In order to do this I’m going to use a toy scenario I like to think about every now and then: getting a PocketQube satellite from low Earth orbit (LEO) to the Moon.

PocketQube

PocketQube – the satellite form factor that fits in your hand!

Since we’re starting in LEO we first need to know: is this drive capable of delivering enough thrust to keep our orbit from decaying? This means compensating for drag, which according to Wikipedia is somewhere between 7.5 – 100 m/s per year depending on altitude. The questions then are “how much power do we have?”, “how high will our thrust be?” and “how high is our mass?”. For these I’m assuming a 5x5x5 cm PocketQube with maximum allowed mass (180 g).

If we have five of the sides of the satellite covered in solar panels, folded out like flower petals and optimally aligned with the Sun, with an efficiency of 20%, then our total power with an insolation of 1300 W/m² (solar constant) becomes: 5*0.05²*1300*20% = 3.25 W. In LEO we’re shaded by the Earth roughly half of the time, so the average power becomes 3.25 / ≃ 1.6 W. Assuming the thrust of the device is linear we then have an average thrust of 20*1.6/700 ≃ 46 nN.

With a thrust of 46 nN and a mass of 180 g (0.18 kg) the average acceleration becomes 256 nm/s². Over a year the accumulated delta-v is 256/10⁹*60*60*24*365 ≃ 8.1 m/s. In other words: if we get to start at an altitude above 600 km we’re probably not going to fall back down again (but only just barely).

So, how long is this trip going to take us? Again I’m going to use Wikipedia, and look up how much delta-v is needed to get from LEO to LLO with this kind of low-thrust drive: 8.0 km/s. I’m also going to be kind and disregard the drag for this one: 8000 / 8.1 = 988 years (!). Now, it’s been a while since we went to the Moon, but something tells me if we’re still around it’s going to happen a lot sooner than the year 3003 :)

Incidentally, this is why for electric propulsion thrust per unit of power is much more important than specific impulse. All the efficiency in the world isn’t going to be of much use if you’re dead by the time your probe arrives at its destination..

SA2TMS rapporterar

Nu för något annorlunda: förra veckan skrev jag och tre andra i stan prov för amatörradiocertifikat efter att ha haft en studiecirkel runt detta i cirka en månad. FURA har skrivit lite kort om det, vilket kan läsas via denna länk. Där finns även en oerhört fotogenisk bild på mig!

Hursom damp själva licensen ner i brevlådan idag, stämplad och allt. Callsign (även känt som signal) blev SA2TMS, där SA2 är beteckningen för Sveriges nordligaste distrikt och TMS är vad jag valde som suffix i all enkelhet.

SA2TMS - med rätt att sända!

SA2TMS – med rätt att sända!

Nu frågar sig läsaren kanske vad detta ska vara bra till. Som allt annat det här året kretsar detta såklart rund scube och våra månidéer. En av dessa är en låghastighetslänk mellan Jorden och sonden, och detta är något vi gärna testar på marken gott om tid i förväg. Planen för det är att placera en sändare och en mottagare på c:a 100 km avstånd (atmosfärens tjocklek) samt sända med en effekt som motsvarar det vi kommer få emot om vi har säg 5W på månen – någonstans runt 1 µW (mindre än en WiFi-accesspunkt men mer än en MP3-FM-sändare). På detta blir det troligtvis något störkänsligt protokoll som JT65 eller PSK31.

Det blev även återigen att lyssna efter internationella rymdstationen ISS förra helgen, ett evenemang framförallt arrangerat av Petter Karkea. Vi fick inte kontakt med någon ombord, men vi (läs: Peter SA2BLV) lyckades lämna ett meddelande i ISS brevlåda. Tydligen ska det stå på ARISS hemsida, men det närmaste jag hittar är att den snappat upp att det är Peter som skickat något. Men en kul utflykt likväl!

Deltagare vid Omberget 2015-06-28. CC-BY-SA Petter Karkea

Deltagare vid Omberget 2015-06-28. CC-BY-SA Petter Karkea

En något mer underhållande användning blir nog att hålla kontakt med ordentliga handradios under något gummibåtsrejs nedför Umeälven senare i sommar.

Slut för denna gång!

Hubski

I suddenly realize I haven’t plugged hubski on this place yet. Hubski is one of many link aggregation/discussion sites on the Web, but it has the distinguishing feature of people on there being somewhat mature and educated when trying to discuss something. I’ve been a member since about two years (under a username I’m keeping secret for now), and so far my stay has been rather pleasant.

Yes, it is a centralized service. But as centralized services go it’s a whole lot better than say reddit, a site which has only recently realized that perhaps hosting a platform for neonazis and virulent fat shamers is perhaps not the best thing to do..

I should also note here that some of the features that hubski implements are things that GNU Social/OStatus has had support for for years, but has yet to catch on in a major way. Neither has hubski, of course. The future will show which one ends up being more popular..

Music Tech Fest

Förra helgen var jag och Petter Ericsson och representerade Umeå HackerspaceMusic Tech Fest. Kort sagt kan man säga att det var mycket trevligt folk, samt att vi vann pris för våran uppfunning: ett enhandsinstrumentet vi döpte till Synthobon. Kort sagt kan man beskriva det som ett elektroniska brassinstrument. Just nu har vi lite funderingar vad man kan göra med det i framtiden.

En kort video som visar instrumentet:

Lite bilder:

tmp_32138-DSC_00341353492899

Domare inspekterar Synthobonen i vårat bås

tmp_32138-DSC_0031-7289187

Närbild på anordningen

tmp_32138-DSC_0040993360719

MTF-deltagare i spacet efter efteråt, måndag

Mad Max: Fury Road

Yesterday I went and saw the new Mad Max movie that’s come out and I’m going to write a few words about it. Beware that there will be marked spoilers in this post. View this as my own little version of Half in the Bag, but suckier because it’s text-only. Incidentally, they also did a review of Mad Max: Fury Road, which disagrees with my views. Oh well, on with the post itself:

First of all, the main selling points of Fury Road: post-apocalyptic vehicular desert action (action, action, action!). This is of course to be expected with a Mad Max film, and it does deliver on that. There’s plenty of car chases, but also lots of interesting mechanical work and prop work to look at. Most of the car chase scenes are real, done with actual modified cars. All of the vehicles are have very interesting designs, and the story works well enough.

But.

There’s always a but(t). And in this case it’s this: while Fury Road is entertaining with lots of things to look at, it has some problems with pacing. In order to explain this I’m first going to break the film down.

WARNING: spoilers below

The movie begins with Max being chased by what looks like raiders. They throw explosives at his V8 Interceptor, causing it to flip over. Max is then captured and brought to what we later learn is The Citadel, to be used as an involuntary blood donor.

The Citadel is built inside two mountains on top of an aquifer and ruled over by Immortan Joe and his many anemic(?) sons, who hoard the water in order to control the poor who live on the ground below. Presumably they maintain control mainly through gunpower, but Joe himself also controls his children by taking on the role of a Norse preist or god. The general structure of the Citadel is likely supposed to echo Bartertown. There’s even a tiny person!

The first half of the movie revolves around a water convoy lead by a woman named Furiosa, sent by the Citadel to the nearby locations of Gas Town and Bullet Farm. The convoy soon takes an unplanned detour, and we learn that Furiosa is actually attempting to smuggle five of Joe’s wives to “the green place”, the home from which she was kidnapped at a young age. This results in a chase sequence that lasts the rest of the first half of the movie. Max is brought along as a living blood bag for Nux, one of Joe’s sons.

After this chase sequence Furiosa, Max, Joe’s escaped wives and Nux (who chooses to defect) manage to make it to their destination, and join up with the all-female remnants of Furiosa’s tribe. We learn that the water in “the green place” turned acid years ago, and that the tribe has been forced to kill and scavange like everyone else ever since.

After some dithering Max convinces everyone to head back to the Citadel, because the tribe has seeds from the time when they used to grow crops, which the Citadel does not (what they’ve been eating for the last 20 years is anyone’s guess). After once again being chased by Joe and his men for most of the second half of the movie, Nux jams the tanker they’ve been driving thus far into a narrow canyon, preventing Joe’s gang from following them. They also manage to kill Joe and steal his car in the process. Max’ old V8 manages to get destroyed as well, which is a shame. Maybe it’ll be back for the sequel, rising from the scrapheap like a mechanical Pheonix!

Finally, what’s left of our gang makes it back to the Citadel. Upon finding it entirely unguarded Max unveils Joe’s corpse strapped to the hood the car, and the entire group is treated as liberators by everone present, including Joe’s anemic sons. Joe’s men never make it back to the Citadel, and everyone is happy, and they can grow crops with the old tribe lady’s seeds. Max winks at Furiosa and disappears into the crowd, never to be seen again. The end!

END OF SPOILERS

Now this isn’t a bad story in itself, even if there’s some holes and some things aren’t explained in detail. A Mad Max film doesn’t need a complicated story. The problem is there’s maybe 30 minutes of exposition for the entire movie, and two one-hour blocks of non-stop action. Of course, action is fun and exciting, but without much break time it gets boring (for me at least). Such time could also be spent explaining characters’ motivation, backstory and so on. We’re also thrown into the first long action sequence almost immediately, with no explanation why we should care. So yeah, this movie has some problems with pacing.

The second thing I’m going to complain about has to do a bit with tone. Early in the film it is made clear that Joe’s wives are basically sex slaves. But they’re shown scantily clad to titillate the audience, which can perhaps be explained by them having recently escaped and being, you know, sex slaves. What pushes it over the top though is when we get what is basically a wet t-shirt scene the first time we see all of them in one shot. That has to have been on purpose!

There’s also a scene where six grown women are unable to wrestle down two unarmed men. The Indian-looking wife who is surprisingly knowledgeable about guns is interesting though.

On a positive note, the red-haired wife takes an interest in Nux when he realizes Joe might be a bad guy. This brief scene provides some amount of emotional depth, which I would have liked to see a bit more of. I should note here that these two characters may be siblings, depending on the precise nature of Joe’s large, somewhat complicated family situation.

Overall I’m a bit lukewarm about this movie. There’s lots of action, the stunts and props are really well made, but I expected a lot slower pacing. Maybe I’m being unfair, but you know what?

Deal with it