OnOff Shim script error "syntax error near unexpected token 'newline'"

Hello I’m pretty new to Raspberry Pi and this is my first time trying to use the OnOff shim on a project. I’m using a fully updated Raspberry Pi Zero W running the lastest 32 bit Raspberry Pi OS. I have also enabled SPI and I2C in the raspberry pi configuration settings. I have been searching this forum and elsewhere for the solution to my problem but have yet to find one.

When I try to run the script:

curl https://get.pimoroni.com/onoffshim | bash

I get the following error:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 --: --:-- 0:00:01 --:–:–
curl: (60) SSL certificate problem: EE certificate key too weak
More details here: https:// curl. se/docs/ sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.

I did some research and seemed to be able to fix this error by changing the script to this:

curl -k https://get.pimoroni.com/onoffshim | bash

Now though when I try to run the new scrip I get this error:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 341 100 341 0 0 1535 0 --:–:-- --:–:-- --:–:-- 1542
bash: line 1: syntax error near unexpected token ‘newline’
bash: Line 1: ‘<?xml version="1.0" encoding="iso-8859-1"?>’

I’m not sure what to do now. Googling these new errors has not yielded anything that seems helpful. If anyone has any advice I’d be very grateful. I can post pictures of the Pi and Shim if its possible this is a hardware problem.

I’ve just run curl https://get.pimoroni.com/onoffshim | bash on a fresh Pi OS install on a Pi Zero W 2, and it installed just fine (although that was 64 bit, I don’t think it should make a difference here?).

curl: (60) SSL certificate problem: EE certificate key too weak

That implies to me that the encryption of HTTPS failed for some reason. Literally the only thing I know about this is that having the wrong time set for your region can cause this to fail; maybe re-set your timezone in sudo apt raspi-config’s localisation options and try it again?

Hi Shoe thanks for your response. I checked the model and it’s actually a Zero W not a Zero W 2, my mistake (I’ve edited my original question to be accurate). So it’s unable to run the 64 bit version but from what I’ve read the shim should still be compatible. I checked the config settings and the timezone is accurate.