Broke my pi by changing password.

Hi all. I reset my password on the pi and now node-red wont work. The error is "failed with result exit-code". GPIO also is giving me an error, "RP1.GPIO.setup(self.__pin, RP1.GPIO.OUT) Rutime warning: this channel is already in use"

How I reset my password was, I pulled the SD card and edited /boot/cmdline.txt on my pc. Then added the line "init/bin/sh" at the end. Put the sd card back and booted up into root shell.

Used "Mount -o remount, rw /". Then "passwd pi" to reset my password. Then "sync" then "exec sbin/init"

Then I put the sd card back into my pc to change cmdline.txt back to its original state. And started my PI. That's when all this trouble started.

Also what's weird is that when I try to run my python script, although it says it will continue to run despite the GPIO error, it just sort of hangs and doesn't run, what the heck did I break?
 
Sounds like pi lost superuser status. Check groups, sudoers, etc. It is not at all clear how they have pi setup. Wish I could help more but I'm not daily using the RPI anymore. For testing only, try running as root.
 
Node-RED: “failed with result exit-code” usually means-
  • The service can’t read its configuration files (permissions wrong)
  • Or the Node-RED user directory (/home/pi/.node-red/) changed owner
  • Or Node.js environment broke

You can run these commands-
Code:
sudo chown -R pi:pi /home/pi
Code:
sudo usermod -aG gpio,spi,i2c,dialout pi
Code:
sudo reboot
Code:
journalctl -u nodered -xe
Reinstall Node-RED dependencies if needed
If logs mention modules missing:
Code:
cd /home/pi/.node-red
npm rebuild
npm install
sudo systemctl restart nodered

You may also be interested in this project. https://www.pcbway.com/project/shareproject/IoT_Using_Raspberry_Pi_and_Firebase_and_Android.html
 
Top