Project Progress #2

November 13, 2023

November 13, 2023

v 7.1

v 7.1

Project Progress #2

November 13, 2023

v 7.1

Setting up a Node-Express server on the pi and making requests to it from the frontend

This week, my Raspberry Pi journey took a turn towards software, as I focused on getting a basic Node-Express server up and running on the Pi Zero W. My usual go-to for coding applications is Visual Studio Code, but I was concerned that it might be too resource-intensive to run directly on the Pi. To work around this, I used a nifty SSH extension in VS Code on my computer. This allowed me to remotely access and edit files on the Pi, ensuring the device wasn't overloaded with heavy computational tasks.

Once I had my coding environment sorted out, I dove into setting up Node.js and Express on the Pi. My goal was simple yet exciting: create a server to listen for GET requests that would eventually control an LED. I didn't have the LED at hand to test the physical aspect, but I used print statements to verify whether the requests were being received by the server. To manage the GPIO pins on the Pi, I integrated a library specifically designed for this purpose.

The next step was to craft a basic HTML frontend. I kept it minimal—a single button designed to send a request to the backend on the Pi, simulating the LED's toggle functionality. With everything in place, I ran the Node-Express server on the Pi and began sending requests from my frontend setup. After a few tweaks and adjustments, it worked!

However, towards the end of the week, I encountered a hiccup. For some reason, I couldn't access the Pi over the network. I suspect the SD card might have gotten corrupted, but thankfully, I've saved the code on another device. Dealing with an SD card as the sole storage medium does add a layer of fragility to the whole setup, but it's a challenge I'm ready to tackle. My plan for the coming week is to re-setup the Pi and bring it back to its former state.

Working with the Pi has reinforced an important lesson: patience and perseverance are key, especially when dealing with such delicate components like an SD card for the operating system. Despite the setbacks, I'm confident in my ability to navigate these issues and keep the project moving forward. Stay tuned for more updates as I continue to explore the possibilities with my Raspberry Pi Zero W.

___

Link to Code

Setting up a Node-Express server on the pi and making requests to it from the frontend

This week, my Raspberry Pi journey took a turn towards software, as I focused on getting a basic Node-Express server up and running on the Pi Zero W. My usual go-to for coding applications is Visual Studio Code, but I was concerned that it might be too resource-intensive to run directly on the Pi. To work around this, I used a nifty SSH extension in VS Code on my computer. This allowed me to remotely access and edit files on the Pi, ensuring the device wasn't overloaded with heavy computational tasks.

Once I had my coding environment sorted out, I dove into setting up Node.js and Express on the Pi. My goal was simple yet exciting: create a server to listen for GET requests that would eventually control an LED. I didn't have the LED at hand to test the physical aspect, but I used print statements to verify whether the requests were being received by the server. To manage the GPIO pins on the Pi, I integrated a library specifically designed for this purpose.

The next step was to craft a basic HTML frontend. I kept it minimal—a single button designed to send a request to the backend on the Pi, simulating the LED's toggle functionality. With everything in place, I ran the Node-Express server on the Pi and began sending requests from my frontend setup. After a few tweaks and adjustments, it worked!

However, towards the end of the week, I encountered a hiccup. For some reason, I couldn't access the Pi over the network. I suspect the SD card might have gotten corrupted, but thankfully, I've saved the code on another device. Dealing with an SD card as the sole storage medium does add a layer of fragility to the whole setup, but it's a challenge I'm ready to tackle. My plan for the coming week is to re-setup the Pi and bring it back to its former state.

Working with the Pi has reinforced an important lesson: patience and perseverance are key, especially when dealing with such delicate components like an SD card for the operating system. Despite the setbacks, I'm confident in my ability to navigate these issues and keep the project moving forward. Stay tuned for more updates as I continue to explore the possibilities with my Raspberry Pi Zero W.

___

Link to Code

Setting up a Node-Express server on the pi and making requests to it from the frontend

This week, my Raspberry Pi journey took a turn towards software, as I focused on getting a basic Node-Express server up and running on the Pi Zero W. My usual go-to for coding applications is Visual Studio Code, but I was concerned that it might be too resource-intensive to run directly on the Pi. To work around this, I used a nifty SSH extension in VS Code on my computer. This allowed me to remotely access and edit files on the Pi, ensuring the device wasn't overloaded with heavy computational tasks.

Once I had my coding environment sorted out, I dove into setting up Node.js and Express on the Pi. My goal was simple yet exciting: create a server to listen for GET requests that would eventually control an LED. I didn't have the LED at hand to test the physical aspect, but I used print statements to verify whether the requests were being received by the server. To manage the GPIO pins on the Pi, I integrated a library specifically designed for this purpose.

The next step was to craft a basic HTML frontend. I kept it minimal—a single button designed to send a request to the backend on the Pi, simulating the LED's toggle functionality. With everything in place, I ran the Node-Express server on the Pi and began sending requests from my frontend setup. After a few tweaks and adjustments, it worked!

However, towards the end of the week, I encountered a hiccup. For some reason, I couldn't access the Pi over the network. I suspect the SD card might have gotten corrupted, but thankfully, I've saved the code on another device. Dealing with an SD card as the sole storage medium does add a layer of fragility to the whole setup, but it's a challenge I'm ready to tackle. My plan for the coming week is to re-setup the Pi and bring it back to its former state.

Working with the Pi has reinforced an important lesson: patience and perseverance are key, especially when dealing with such delicate components like an SD card for the operating system. Despite the setbacks, I'm confident in my ability to navigate these issues and keep the project moving forward. Stay tuned for more updates as I continue to explore the possibilities with my Raspberry Pi Zero W.

___

Link to Code

© Swostik Pati 2023

© Swostik Pati 2023

© Swostik Pati 2023