Skip to content

MindsHub/radioala-esp

Repository files navigation

Per l'italiano guarda sotto

RadioAla-esp, a webradio receiver written in Rust

This project is a webradio receiver, and it is based on espressif hardware, but given the utilization of high level libraryes like embassy should be easy to translate to other boards.

Hardware requirements

We used a Lilygo ttgo, which included an A7670E modem, and an esp32-wrover. When we bought this it was 20€, now it seems to have increased in price, but as long as the hardware is similar there should be no problem. We also used a PCM5102A (a 2€ module that converts i2s signals to high precision analog outputs). The quality of the generated signal surpiresed us.

It requires also a sim with a 4G plan active for the modem, and to set the correct apn in config.rs file.

Hardware connections

We used the following connections, but you are free to change them to fit your needs:

  • 26 modem tx
  • 27 modem rx
  • 04 modem power
  • 12 modem en
  • 05 modem reset
  • 23 I2S out
  • 21 I2S ws
  • 19 I2S sck

How to install dependencies

In order to compile and use this project, you need some requirements.

  • Install rustup (the Rust toolchain manager), go to rustup site, and follow the instruction. For linux it is easy, on windows the installation is a little more convoluted, and requires to install some vscode packets.
  • Using rustup install the default toolchain (we will use it to install some dependencies) rustup install stable
  • Then we need to install espflash, a tool that we will use to flash on the device, and monitor the logs: cargo install espflash it may require additional steps to configure usb permissions.
  • Then we need to install espup, a tool that will install the non standard esp32 toolchain on our machine: cargo install espup
  • We could use espup to install the toolchain: espup install on windows it should work right away, instead on linux it could be necessary to set some envs (look at the documentation).

After all this step we are ready to flash our code!

How to build and flash the program

simply run in a console inside this folders: cargo run --release --bin radio_ppp --features="ppp-modem" and if you set up all correctly you should see a standard compilation, and after a flash the output from the module. If you want to run the experimental wifi implementation, you can run: SSID="WIFI-NAME" PASSWORD="WIFI-PASSWORD" cargo run --release --bin radio_wifi --features="esp-wifi". Keep in mind that at the moment of writing it is still unstable, and it resets once every half an hour (I think when wifi modem does the WPA2 key rotations).

RadioAla-esp, un ricevitore per webradio scritto in Rust

Questo progetto è un ricevitore per webradio, ed è basato su hardware espressif, ma dato l'utilizzo di librerie ad alto livello come embassy dovrebbe essere facile da tradurre per altre schede.

Requisiti hardware

Abbiamo utilizzato una Lilygo ttgo, che includeva un modem A7670E, e un esp32-wrover. Quando l'abbiamo comprata costava 20€, ora sembra essere aumentata di prezzo, ma finché l'hardware è simile non dovrebbero esserci problemi. Abbiamo anche utilizzato un PCM5102A (un modulo da 2€ che converte i segnali i2s in uscite analogiche ad alta precisione). La qualità del segnale generato ci ha sorpreso.

Richiede anche una sim con un piano 4G attivo per il modem, e di impostare l'apn corretto nel file config.rs.

Connessioni hardware

Abbiamo utilizzato le seguenti connessioni, ma sei libero di cambiarle per adattarle alle tue esigenze:

  • 26 modem tx
  • 27 modem rx
  • 04 modem power
  • 12 modem en
  • 05 modem reset
  • 23 I2S out
  • 21 I2S ws
  • 19 I2S sck

Come installare le dipendenze

Per compilare e utilizzare questo progetto, sono necessari alcuni requisiti.

  • Installa rustup (il gestore di toolchain Rust), vai sul sito di rustup, e segui le istruzioni. Per linux è facile e basta un comando, mentre su windows l'installazione è un po' più convoluta, e richiede di installare alcuni pacchetti per vscode.
  • Usando rustup installa la toolchain di default (la useremo per installare alcune dipendenze) rustup install stable
  • Poi dobbiamo installare espflash, uno strumento che useremo per flashare sul dispositivo, e monitorare i log: cargo install espflash potrebbe richiedere ulteriori passaggi per configurare i permessi usb.
  • Poi dobbiamo installare espup, uno strumento che installerà la toolchain non standard per esp32 sulla nostra macchina: cargo install espup
  • Potremmo usare espup per installare la toolchain: espup install su windows dovrebbe funzionare subito, invece su linux potrebbe essere necessario impostare alcune variabili d'ambiente (guarda la documentazione).

Dopo tutti questi passaggi siamo pronti a flashare il nostro codice!

Come compilare e caricare il programma

Basta eseguire in una console all'interno di questa cartella: cargo run --release --bin radio_ppp --features="ppp-modem" e se hai configurato tutto correttamente dovresti vedere una compilazione standard di Rust, e dopo un flash l'output dal modulo. Se vuoi eseguire l'implementazione sperimentale del wifi, puoi eseguire: SSID="WIFI-NAME" PASSWORD="WIFI-PASSWORD" cargo run --release --bin radio_wifi --features="esp-wifi". Tieni presente che al momento della scrittura è ancora instabile, e si resetta una volta ogni mezz'ora (penso quando il modem wifi fa le rotazioni delle chiavi WPA2).

About

a webradio receiver written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages