Thursday, July 30, 2015

Qml item state undefined

I'm working on a info screen application done in Qml that will be run on a Raspberry Pi. I'm doing the main coding on the desktop and everything runs well.

On the Pi I'm using a self build of Qt 5.4.2 and it worked very well, until yesterday that is. Suddenly I got no display of my info slides. Strange thing, it worked perfeclt fine before.

After a good bit of cursing I found that my Image didn't show, because for some odd reason the binding of

visible: root.state=='rotating'

was evaluated as false. Well, how the hell is that possible was the next question. And debug output of the state randomly said "undefined", eh ?? WTF!?

What I don't understand is how it suddenly crept up as I've used states before too in my app. Anyway, it turns out that it is a known bug (QTBUG-41649) in gcc-4.6 on arm that miss compiles a specific file in the Qml library.

 Fix applied and all seems well. I hope.

Thursday, July 02, 2015

More progress with wireless sauna temperature thingy

My original plan was to use a MSP430 based launchpad (cheap!) instead of an Arduino for the sensor part. I had major troubles getting any data to go trough so decided to first try with identical platforms and libraries. That worked so at least I knew that my NRF modules where ok.

I started to look into using the MSP430 based launchpad now, first I had some weird trouble that a simple test worked, then suddenly it didn't and sometimes just a part of the data got trough to the receiver. Digging into the enrf24 and RF24 libraries a bit more I found the reason (enrf24 uses dynamic payload (only!) by default, RF24 doesn't) and connecting my MAX6675 thermocouple amp also made the sending not work if I used a particular pin (I think it was 2.3?) on the launchpad, moving that to 1.4 fixed that issue.

Now it works!


I'm now powering the sensor with a USB power bank and that just wastes energy so next is to make everything as power efficient as I can and power it using a 3V coin-cell.

That should be possible as I can sleep most of the time as the temperature does not change that fast and often anyway.

Perhaps something like:
  • Average temperature, say for 3 samples, does not change much: Sleep 30 seconds
  • If temperature starts to change, sleep less, say 10 seconds
  • If temperature changes rapidly, sleep 5 seconds
  • Send temperature only when temperature changes
Comments ?