pimoroni / get

Install and helper scripts for Raspbian on the Raspberry Pi
Other
9 stars 7 forks source link

explorerhat script on Jessie #2

Closed RogueM closed 8 years ago

RogueM commented 8 years ago

tested against img 20015-09-24, straight after first boot

reboot did not help. I had to manually launch raspi-confi, enable i2c and reboot. Then everything seemed to work - only tried test.py using python2 and python3.

RogueM commented 8 years ago

I tested against Wheezy img 2015-05-05, straight after first boot

one important note here is that the enabling of i2c was marked as success in green, with prompt a reboot would be required in red. As expected a reboot was required, but no manual fiddling with raspi-config was required!

Gadgetoid commented 8 years ago

Darn. This might explain the recent surge of confused Explorer HAT users.

For the record, I get my "enable i2c" logic from Raspi Config's guts. Ideally I'd love raspi-config to accept command-line arguments like: sudo raspi-config i2c enable, but I don't think that's ever going to happen; the display logic and functionality of raspi-config are very tightly intertwined.

RogueM commented 8 years ago

Hum, I feared raspi-config could be quite opaque... is launching it, directed to the appropriate screen at the end of the 'get' script technically possible maybe?

RogueM commented 8 years ago

been trying to get my head around your i2c script. Probing a Jessie image with a script derived from it it seems to me that the problem is that the kernelatleast function is failing... I'm looking into it but can't say I fully understand how it's supposed to work.

RogueM commented 8 years ago

on this image I get $kver=417+ which is then failing the comparison since it isn't an integer.

RogueM commented 8 years ago

I must say I'm immensely confused... by the looks of it you format kver to 4 char (expecting an int), but then call the function with a parameter 5 char long... wouldn't you always get the same result from the -ge comparison?

RogueM commented 8 years ago

PR filed. But like I said the kernelatleast logic seems decorative to me, I can't see its value but I might be missing the obvious.

Still, unless you have time to look at it I would recommend pushing those 'fixes' as I believe all the Pimoroni stuff requiring either i2c or spi suffer from the same issue i.e users are required to enable those interfaces manually.

Gadgetoid commented 8 years ago

I think I might have been having one of those programming moments when I hacked up the kernel check. I felt it was necessary to make sure the scripts don't run on any untested platforms, but Raspbian doesn't change that much.

I'll have a look at your tweaks!

RogueM commented 8 years ago

My best guess is that you wanted to protect against some early Jessie distro, based on kernel version 3.18.5.0, but I think line 16 should have been 'kver=${kver:0:5}' to have any effect.

... I think it will be worth revising the code at some point, as it is (or was for that matter) the kernel check will never have any effect. Maybe keep the function in but comment it to reflect it's just there in case you need it?

RogueM commented 8 years ago

closing this one, if any other changes should be done this is to the i2c(spa) scripts.