Connect your old computers to the internet and more!
leanmodem was made for the nodemcu and the ESP8266. It allows you to connect to the internet via a simple text interface. You can also use it to store files from the old computer into the device and viceversa.
Adding support for a full traditional landline modem is on the roadmap. Once it's done your old computer will be able to use it without knowing it's actually using the internet.
- Download the full sketch.
- Download the dependencies.
- Compile and install it to your nodemcu.
- Have fun!
You need to have the Arduino IDE installed and properly set up for compiling programs and installing them in the nodemcu.
- Download the full code, unzip it in a folder inside your
arduino
. - Set up your IDE so that you can install programs in the nodemcu. Read this guide in case you need help.
- In case you didn't follow the guide, make sure that you have installed the support for your nodemcu. Go to
Tools -> Board ... -> Board Manager
and install esp8266 2.5.2 by ESP8266 Community. - Go to
Tools -> Library Manager
and install the dependencies for leanmodem. Please be aware that using newer versions could cause compatibility issues. They libraries are:
ESP8266-ping
2.0.1 by Alessio LeonciniNTPClient
3.2.0 by Fabrice WeinbergCrypto
0.2.0 by Rhys WeatherleyWiFiEsp
2.2.2 by bportaluri
- Since this project uses SPIFFS you will need to install the proper tools. Go to their repository and follow the instructions.
- Set up your Arduino IDE with the following settings:
- Board:
Generic ESP8266 Module
- Flash Size:
4M (1M SPIFFS)
- You should be ready to compile and install the project into your nodemcu. Again, let me know if you have issues. That will help me to improve these instructions, if necessary.
leanmodem is using by plugging the nodemcu to your computer using a micro-USB cable. Then, you need a terminal emulator such as PuTTY to connect to the proper COM port that was automatically assigned to the nodemcu after you connected it. Make sure that you set the appropriate speed as set in the CFG_CONSOLE_BAUD_RATE
option in config.h
. At time of this writing, the speed is 19200 bauds.
Once you see the command prompt you will be able to use the following commands. Make sure you always use lowercase characters, otherwise your commands won't be recognized.
Clears the screen. Only works if your Terminal supports ANSI codes and your ANSI flag is set to yes.
Allows you to see the current settings, change, load and save them.
config
: displays the device configurationconfig load
: loads configuration from system fileconfig save
: saves configuration to system fileconfig set [setting] [value]
: Sets [value] to [setting].String
means the argument requires values to be text.Boolean
means the argument has to beyes
orno
.Number
means the argument must be a number between -32768 and 32787. Valid settings are:- id [String] the name of your device.
- ssid [String] the SSID of your wireless network.
- pass [String] the password for your wireless network. BE AWARE that your WiFi password will be stored in plaintext in your device, and you can even see it among the other configuration values.
- sound [Boolean] Enables sounds via the pin specified in
CFG_BUZZER_PIN
. - ansi [Boolean] Enables leanmodem to use ANSI codes for enhanced terminal output, with colors and more complex interfaces.
- echo [Boolean] When set to
yes
this setting returns all user input to your terminal, displaying it on the screen. - autoconnect [Boolean] when set to
yes
leanmodem will automatically connect to the wireless network during startup. - unix [Boolean] when set to
yes
, all line-endings will be LF only (Unix compatible). If set tono
line-endings will be CRLF (Windows compatible). - server [Boolean] when set to
yes
, the device will automatically start up the tcp server at startup, only if the wifi connection was established.autoconnect
should also be set toyes
for this to work. - timezone [Number] sets the current timezone. This will affect how time is displayed by your device.
- timeout [Number] number of milliseconds that the device waits before cutting communication with a remote device. A larger number will make it more resistant to errors but it will make it more unresponsive to the user. A smaller number makes it faster and more responsive, but it could result in communications being cut before it's due (this is a risk with older computers or during user interaction).
Connects to the wireless network using the SSID and password previously set with config
.
This is one of the most powerful commands in leanmodem. It copies information from [source]
to [target]
. For instance, it copies user input to a file, or data from a file to another (making a duplicate), or even information from a TCP socket, or data downloaded via HTTP. Check out these examples:
copy stdin somefile
: read information from the user and writes it down tosomefile
. Once you are done typing just wait for it to timeout and it will save and close the output.copy somefile anotherfile
: creates a new file calledanotherfile
with the contents ofsomefile
.copy somefile stdout
: retrieves the contents of somefile and dumps them to your terminal, displaying it. Be aware that displaying binary files might confuse or crash your terminal.copy tcp://192.168.0.1:8080 somefile
: it opens a raw TCP socket to192.168.0.1
at port8080
and dumps everything that it receives through it tosomefile
.copy http://www.example.com/ website
: connects to the provided URL using default port 80, downloads the webpage and dumps it in a local file calledwebsite
. Be aware, only HTTP/1.0 is supported. HTTPS is not supported... yet.
Erases the specified local file
Displays the files stored in the local filesystem. By default it displays user files, but you can use the -s
argument to see the system files. System files are usually not accessible by the user by using the terminal alone.
Erases all the information in the device, including the system configuration. It restores the device to its "factory" settings.
Displays a list of all available commands and a short explanation for each one.
Displays the contents of the specified file using the classic hex editor style.
Pings the remote host using the standard ICMP method.
It allows you to play pong! Yes, you read that correctly. Try it out! You need an ANSI compatible terminal.
While this may be fun, it does take up some program space in your device. You can remove by commenting out the line that reads #define PONG_SUPPORT
in the main file under Build Settings.
Restarts the device
Scans for nearby wireless networks
Starts a TCP server listening in the port as defined with config
. This is an EXPERIMENTAL and UNSAFE feature since it doesn't use any encryption at all!
You can remove this feature from the build if you just remove or comment out the line that reads #define TCP_SERVER_SUPPORT
under Build Configuration in the main file.
Sets a GPIO pin to digital output and sets it HIGH or LOW depending on the provided parameter. For the nodemcu the only available pins are 0, 2, 5, 4, 14, 12 and 13. Check out this website for more information about usable digital output pins in the nodemcu.
Calculates the sha256 hash of the specified local file.
It connects via WiFi to the specified telnet host. This is great for old computers to connect to Internet-based old-style bulletin boards (BBS).
It queries the current time using NTP and displays it on the screen using the device's timezone
setting.
Returns the about information and the build date.
It receives a file from the computer using the old standard xmodem-crc protocol. This was tested with old programs like Windows 3.0 Terminal application.
Sends the specified local filename to the connected computer using the xmodem-crc binary protocol.
- Leandro Tami - reach me on Twitter by my handle @leandrinux
This project is licensed under the MIT License:
Copyright 2019 Leandro Tami
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
To all those people who worked so hard to make the software and hardware that allowed me to build this and have so much fun.