Add non-functional server code for RPi

This commit is contained in:
Terence Boldt 2020-12-04 00:28:10 +00:00
parent 04b002098c
commit 44a1381b28
5 changed files with 104 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*-bak
node_modules

View File

@ -9,5 +9,23 @@ This is a very early stage project. Currently one partially completed hand wired
## Purpose
The purpose of this project is to provide I/O for an Apple II series 8 bit computer via a Raspberry Pi Zero W which is powered by the Apple II expansion bus. Initially this would be storage via virtual ProDOS compatible drive. Next might be adding virtual serial card support over wifi. Future enhancements could use the RPi for more complex processing as per request from the Apple II. For example, the Apple II could request a web page or application and the RPi could calculate this in Apple II hi-res graphics mode and send the image data back to the II for display purposes.
## Setup
1. Have PCBs made from the gerber and drill files in the Hardware folder
2. Solder chips, header and capacitors in place
3. Attach Raspberry Pi Zero W facing outward from the card
4. Install Raspberry Pi OS on microSD card
5. Configure wifi in boot/wpa_supplicant.conf
6. Add empty ssh file boot (for ssh access over wifi)
7. Put microSD card in the RPi
8. Install the expansion card into the Apple II
9. Power on the Apple II
10. Install NodeJS 11 for ARMv6 on the RPi over ssh
11. sudo npm install -g pm2
12. pm2 startup systemd
13. Run the command from the output of the previous step
14. pm2 start server.js
## Similar Project
If you're looking for complete hardware design or prefer having Apple II peripherals control a control a Raspberry Pi rather than simply using the Raspberry Pi to provide storage and network access to the Apple II, have a look at David Schmenk's excellent [Apple2Pi](https://github.com/dschmenk/apple2pi) project.

49
RaspberryPi/package-lock.json generated Normal file
View File

@ -0,0 +1,49 @@
{
"name": "apple2-io-rpi",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"epoll": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/epoll/-/epoll-4.0.0.tgz",
"integrity": "sha512-dENZbykco5w/vsFHuhD/5zla9VHm3htP1ROoX9MCc6L/7LVqGPFfcGS/g+/+pQLUclKw4uR9HnaZmsZ6fi5n+Q==",
"requires": {
"bindings": "^1.5.0",
"nan": "^2.14.1"
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
},
"lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
},
"nan": {
"version": "2.14.2",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz",
"integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ=="
},
"onoff": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/onoff/-/onoff-6.0.1.tgz",
"integrity": "sha512-lqnVyUiWLbb4T6sWTaOeCJn682EPyxaTyfJ5bP5LiTa0KMDlVPQR0ngVgzV3SkRkd0JnNxPvwTNj7QVvZTZsAw==",
"requires": {
"epoll": "^4.0.0",
"lodash.debounce": "^4.0.8"
}
}
}
}

14
RaspberryPi/package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "apple2-io-rpi",
"version": "0.0.1",
"description": "Apple2 I/O Card with Raspberry Pi Zero W",
"main": "server.js",
"scripts": {
"test": "jest"
},
"author": "Terence J. Boldt",
"license": "GPL-3.0-or-later",
"dependencies": {
"onoff": "^6.0.1"
}
}

22
RaspberryPi/server.js Normal file
View File

@ -0,0 +1,22 @@
var fs = require('fs');
var gpio = require('onoff').Gpio;
var output = new gpio(4, 'high', {activeLow: true});
var input = new gpio(6, 'in', 'both');
function onCleanUp() {
output.unwatchAll();
output.unexport();
input.unexport();
}
function onStatusChanged(err, value) {
if (err) {
}
else {
}
}
input.watch(onStatusChanged);
process.on('SIGINT', onCleanUp);