Close

Vintagephone software

A project log for Vintagephone - old rotary phone retrofitting

An open project to bring new functionalities to vintage phones with the nice old rotary, keeping their fascinating vintage style alive.

giulio-ponsGiulio Pons 06/23/2022 at 21:560 Comments

Software components

Vintagephone software is composed by different parts.

We have some functions to control the bells, the rotary encoder and the switch.

We have functions that handle the clock methods, for setting the time and check the timer for alarms.

We have functions that handle the mp3 player, play and stop an mp3 track.

We have many functions to handle the Wemos functionalities, such as the OTA (Over The Air) update process, to upload new sketches without plugging the usb cable, or the functionalities to handle the captive portal when the Vintagephone is in AP mode (Access Point). The first time you will use it you'll need the AP Captive Portal to configure the acccess to your wifi. You can use your smartphone to confgiure it.

The AP captive portal uses the SPIFFS, the simplified file system that is used to store the HTML, css and JS for the portal. 

Then with Wemos we have access to the WWW where we can get correct time information and other services such as the meteo service.

All the libraries used are available in the Arduino software library.

Phone status

Every time Vintagephone is used the phone keeps track of its status.

There are 5 status:

For example when a user call 1 to ask the correct time, the Vintagephone passes from one status to the other like this:

This sequence is the same for all the calls dialed. Ringing status is not touched.

When you set an alarm a time is setted and when the triggering time is reached the sequence is a bit different:

If the user put down the handset during an answer or doesn't answer when the phone is ringing, the software detects the closing of the switch and stop the player and go back to the initial status. So the complete diagram for the phone status is this:

You can customize services and answers in the main loop, by adding blocks of code:

// #3456789 YOUR CUSTOM NUMBER THAT NOT MATCH PREVIOUS NUMBERS
// ---------------------------------------------------------------
if(phoneNumber=="3456789") {
   found = true;
   setPhoneStatus(ANSWERING);

   //
   // Add your code here
   // then play your tracks
   //
   // use playTrackNum(x, WAIT_END) to play mp3 number x in mp3 folder.
   // use playTrackFolderNum(x,y, WAIT_END); to play mp3 number y in x folder.
   // use WAIT_END if you want the process to wait the end of the mp3
   //
   
   setPhoneStatus(CALL_ENDED);
   playTrackNum(1);
}
      

Everytime you want to add a new service, if you need different phrases, you'll probably need to open the case to reach the micro sd card and add the new mp3 files.

Github

All the code is available on github and it's well commented!

https://github.com/giuliopons/vintagephone

Discussions