Giter VIP home page Giter VIP logo

radio's Introduction

radio's People

Contributors

andrasbiro avatar cgarces avatar derkleineleif avatar fjansson avatar gartnl avatar mathertel avatar mcgurk avatar npoole avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

radio's Issues

define debug , missing symbol

What does it mean, when compiling with radio.h gives warning: (Esp32 wroom)
L:\Arduino scripts\libraries\Radio\src/radio.h:62:16: error: expected '}' before 'attribute'
#define UNUSED attribute((unused))

compiling doesnt like rds parser

Made an update of the radio.h to latest version of radio.h and got this. how to fix this for esp32 wroom?
sketch\arduino_radio7_Si4703_V1_Tiny_RTC_copy3.ino.cpp.o:(.literal._Z5setupv+0x78): undefined reference to RDSParser::attachServiceNameCallback(void (*)(char const*))' sketch\arduino_radio7_Si4703_V1_Tiny_RTC_copy3.ino.cpp.o:(.literal._Z5setupv+0x7c): undefined reference to RDSParser::attachTextCallback(void ()(char const))'
sketch\arduino_radio7_Si4703_V1_Tiny_RTC_copy3.ino.cpp.o: In function setup()': K:\Arduino scripts\arduino_radio7_Si4703_V1_Tiny_RTC_copy3/arduino_radio7_Si4703_V1_Tiny_RTC_copy3.ino:3541: undefined reference to RDSParser::attachServiceNameCallback(void ()(char const))'
K:\Arduino scripts\arduino_radio7_Si4703_V1_Tiny_RTC_copy3/arduino_radio7_Si4703_V1_Tiny_RTC_copy3.ino:3541: undefined reference to `RDSParser::attachTextCallback(void ()(char const))'
collect2.exe: error: ld returned 1 exit status

rda5807 setband not saving setting to register

Easy to fix ..
In rda5807m.cpp function setBand() is not sending the register-value to the chip.
At the end of the function '_saveRegister(RADIO_REG_CHAN);' is missing.

made a pull request for it.

Regards

Henk

Library on Leonardo

Hello Matthias,

Thank you for this great library. I have to point out that this lib does work with only UNO at the moment. And that's because different boards use different pins for TWI communication using the Wire library. For Leonardo and Micro the pinout must be different than the shown on the examples:

FM Chip     |    Arduino
------------|------------
SDIO        |    D2
SCLK        |    D3

For more information on other boards use this link.

To solve the problem and make my chip (Si4703) work with the Leonardo, I changed the lines 36,38 in the SI4703.cpp accordingly:

#define resetPin 4
#define SDIO 2

I hope this is helpful to someone out there.

PS. I did try to update the SI4703.cpp with:

SI4703::SI4703(int sdioPin, int sclkPin, int rstPin) {
     // Something here
}

but didn't work. I guess it's something with the .h file. (I have absolutely no idea on how to use C++. Just learning).

And again thank you. This works like a charm!

fail at bassboost

Only SI4703 is decleared in the script, however there are compiler warnings for SI4705:

Driveletter:\Arduino scripts\libraries\Radio\src\SI4705.cpp:229:34: error: variable or field 'setBassBoost' declared void
void SI4705::setBassBoost(UNUSED bool switchOn) {
^
Driveletter:\Arduino scripts\libraries\Radio\src\SI4705.cpp:229:27: error: 'UNUSED' was not declared in this scope
void SI4705::setBassBoost(UNUSED bool switchOn) {

Si7403 #define IN_EUROPE hardcoded

For Si4703, the region setting is hardcoded:

#define IN_EUROPE

Would it be possible to make this configurable? The European spacing (100 kHz) is finer than the US spacing (200 kHz), so US stations can still be tuned. The IN_EUROPE flag also applies the European de-emphasis setting of 50 us.

Related: would it be possible to support the Japanese FM band 76–95 MHz ?

Case issues in the code

It seems that within many .cpp and .h files there are issues with the case under Linux. In many places, the code refers to "arduino.h" when it should refer to "Arduino.h". The same occurs when it refers to "RADIO.h"; it should refer to "radio.h".

Setting volume on RDA5807 in quick succession causes corruption in registers

Hi Matthias!

First, Thank you very much for your support of these libraries! I am very happy to see these in active(ish) development 👍

I am using RDA5807 chip with a custom PCB. The frequency and volume of the RDA are controlled with a rotary encoder. When we turn the rotary encoder too quickly, there are times when it causes corruption in the registers (such as changing the frequency to an invalid value). I have tried to create a critical section using sei/cli to turn off interrupts just in case, but that did not make much of a difference.

I have several of these pcb's and this issue occurs on only one of them which may indicate some electrical issue perhaps thats corrupting the registers somehow.

Do you have any additional thoughts on why this might occur?

Also, can you perhaps recommend a way to do "error correction"? In other words, I can currently do something like radio.getFrequency and detect that it's different from what my sketch expects it to be. Once I detect this, is there a way to "reset" the registers to known values? (I tried to term and then init but that caused even more problems.

Thanks!

RDA5807M + Arduino Pro Micro + SerialRadio Example = Random Freezing

Hello,
At the beginning thank you for this work , It's very interesting project and comprehensive solution to easy implement of SDR receivers.
I have a problem like this :
I connected typical RDA5807 module to Arduino Micro and have uploaded example from your library - SerialRadio. Everything looked good , i could give serial commands to the radio( like frequency change (fxxxxx) , seekUp , seekDown , volume +/- ) , i could receive RDS messages but after few minutes I lost communication with radio via serial.
In other case i have connected a LCD with I2C converter and encoder to manually control of radio(change frq , vol etc...) . Frequency , and RDS was displayed properly , I could control radio by encoder but after few minutes everything froze again and I couldn't control radio by encoder. RDS refreshing was frozing too. I2C Addresses of LCD and RDA are different , I think that isn't a problem. In my custom implementation I turned off a serial communication.
I have tried to comment parts of code with control encoder but It still isn't It and It did not help.

Below is my implementation of your code with LCD control :

#include <EEPROM.h>
#include <newchip.h>
#include <radio.h>
#include <RDA5807M.h>
#include <RDSParser.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define outputA 6
#define outputB 7
#define zeroButton 8
int counter = 0;
int aState;
int aLastState;
int n = LOW;
unsigned long swTime = 0;
bool turnRight = false;
bool turnLeft = false;
int mode = 0;
int volumeEnc = 0;
int volumeSet;
RADIO_FREQ fqToSave;

byte Vol1[8] = {
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B11111,
};

byte Vol2[8] = {
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
};

byte Vol3[8] = {
B00000,
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
B11111,
};

byte Vol4[8] = {
B00000,
B00000,
B00000,
B00000,
B11111,
B11111,
B11111,
B11111,
};

byte Vol5[8] = {
B00000,
B00000,
B00000,
B11111,
B11111,
B11111,
B11111,
B11111,
};

byte Vol6[8] = {
B00000,
B00000,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};

byte Vol7[8] = {
B00000,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};

byte Vol8[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};

LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set LCD address on 0x3F
RADIO_FREQ preset[] = {
10160,
9300,
10270,
8850,
8890,
8930,
8980,
9180,
9220,
};
int i_sidx=0; ///< Start at Station with index=5
RDA5807M radio; ///< Create an instance of a RDA5807 chip radio
RDSParser rds;
void DisplayFrequency(RADIO_FREQ f)
{
char s[12];
radio.formatFrequency(s, sizeof(s));
lcd.clear();
lcd.setCursor(0,0);
lcd.print(s);
lcd.print(" ");
if(mode == 0)
{
lcd.print("Tun");
}

if(mode == 1)
{
lcd.print("Mem");
lcd.print(" ");
lcd.print(i_sidx+1);
}

if(mode == 2)
{
lcd.print("Vol");
}
lcd.setCursor(8,1);
lcd.print(" ");

if(volumeEnc == 0)
{};

if(volumeEnc > 1 && volumeEnc <5)
{
lcd.write((uint8_t)0);
};

if(volumeEnc > 4 && volumeEnc < 8)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
};

if(volumeEnc > 7 && volumeEnc < 9)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
};

if(volumeEnc > 8 && volumeEnc < 11)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
};

if(volumeEnc > 10 && volumeEnc < 13)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
};

if(volumeEnc > 12 && volumeEnc < 14)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
lcd.write((uint8_t)5);
};

if(volumeEnc > 13 && volumeEnc < 16)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
lcd.write((uint8_t)5);
lcd.write((uint8_t)6);
};
}

void DisplayServiceName(char *name)
{

char s[12];
radio.formatFrequency(s, sizeof(s));
lcd.clear();
lcd.setCursor(0,0);
lcd.print(s);
lcd.print(" ");
if(mode == 0)
{
lcd.print("Tun");
}
if(mode == 1)
{
lcd.print("Mem");
lcd.print(" ");
lcd.print(i_sidx+1);
}
if(mode == 2)
{
lcd.print("Vol");
}
lcd.setCursor(0,1);
lcd.print(name);
lcd.print(" ");
if(volumeEnc == 0)
{
};

if(volumeEnc > 1 && volumeEnc <5)
{
lcd.write((uint8_t)0);
};

if(volumeEnc > 4 && volumeEnc < 8)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
};

if(volumeEnc > 7 && volumeEnc < 9)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
};

if(volumeEnc > 8 && volumeEnc < 11)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
};

if(volumeEnc > 10 && volumeEnc < 13)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
};

if(volumeEnc > 12 && volumeEnc < 14)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
lcd.write((uint8_t)5);
};

if(volumeEnc > 13 && volumeEnc < 16)
{
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
lcd.write((uint8_t)5);
lcd.write((uint8_t)6);
};
} // DisplayServiceName()

void RDS_process(uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4) {
rds.processData(block1, block2, block3, block4);
}

void SetRadioVolumeByENC(int val){
if(val == 0)
{
radio.setMute(true);
}
else
{
radio.setMute(false);
}
radio.setVolume(val);
}

void setup() {
pinMode (outputA,INPUT_PULLUP);
pinMode (outputB,INPUT_PULLUP);
pinMode (zeroButton , INPUT);
digitalWrite(zeroButton, HIGH);
aLastState = digitalRead(outputA);
delay(500);
lcd.begin(16,2);
lcd.createChar(0, Vol1);
lcd.createChar(1, Vol2);
lcd.createChar(2, Vol3);
lcd.createChar(3, Vol4);
lcd.createChar(4, Vol5);
lcd.createChar(5, Vol6);
lcd.createChar(6, Vol7);
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Radio FM");
delay(1000);
lcd.setCursor(0,1);
lcd.print("Version 1");
delay(1000);
radio.init();
radio.setBandFrequency(RADIO_BAND_FM, preset[i_sidx]); // 5. preset.
radio.setMono(false);
radio.setMute(false);
radio.setVolume(5);
volumeEnc = 5;
radio.attachReceiveRDS(RDS_process);
rds.attachServicenNameCallback(DisplayServiceName);
}

/// Constantly check for serial input commands and trigger command execution.
void loop() {
unsigned long now = millis();
static unsigned long nextFreqTime = 0;
static RADIO_FREQ lastf = 0;
RADIO_FREQ f = 0;

if (digitalRead(zeroButton) == LOW)
{
swTime = millis();
delay(500); //debounce
// check if the switch is pressed for longer than 1 second.
if(digitalRead(zeroButton) == LOW && swTime - millis() > 5000)
{
if(mode == 1)
{
fqToSave = radio.getFrequency();
preset[i_sidx] = fqToSave;
}
char s1[12];
radio.formatFrequency(s1, sizeof(s1));
delay(1000);
}
else
{
if(mode == 2)
{
mode = 0;
}
else
{
mode++;
}
int fq = radio.getFrequency();
DisplayFrequency(fq);
}
}

n = digitalRead(outputA);
if((aLastState == LOW) && (n == HIGH))
{
if (digitalRead(outputB) == LOW)
{
if(mode==0)
{
radio.seekUp(false);
//radio.seekDown(true);
}
if(mode == 2)
{
if(volumeEnc<15)
{
volumeEnc++;
SetRadioVolumeByENC(volumeEnc);
int fq = radio.getFrequency();
DisplayFrequency(fq);
}
}
if(mode == 1)
{
if (i_sidx < (sizeof(preset) / sizeof(RADIO_FREQ))-1) {
i_sidx++; radio.setFrequency(preset[i_sidx]);
int fq = radio.getFrequency();
DisplayFrequency(fq);
}
}
}
else {
if(mode==0)
{
radio.seekDown(false);
//radio.seekUp(true);
}
if(mode == 2)
{
if(volumeEnc>0)
{
volumeEnc--;
SetRadioVolumeByENC(volumeEnc);
int fq = radio.getFrequency();
DisplayFrequency(fq);
}
}
if(mode == 1)
{
if (i_sidx > 0) {
i_sidx--;
radio.setFrequency(preset[i_sidx]);
int fq = radio.getFrequency();
DisplayFrequency(fq);
}
}
}
}
aLastState = n;
radio.checkRDS();
if (now > nextFreqTime) {
f = radio.getFrequency();
if (f != lastf) {
// print current tuned frequency
DisplayFrequency(f);
lastf = f;
} // if
nextFreqTime = now + 400;
} // if
}

Could you help me with this problem ? I would be very grateful for your help :)
Best regards.
Matthew.

Where is the actual register access code?

Forgive my poor grasp of how include files work. I have been successfully including and using the radio.h and RDA5807M.h files with my project (Arduino Nano drives 3 FM radios, and reads back RSSI info to select best signal for audio output). For speed, I would like to directly read/write single RDA registers , and got very confused reading the RDA spec sheet. So I tried to use the *.h files for examples of how to do this, but don't understand how to find the actual low level code that does the register communication. I see a lines like this:

// ----- combined status functions -----
183 virtual void getRadioInfo(RADIO_INFO *info);

I am successfully using getRadioInfo() using a pointer to the structure, but can't find the actual function code. Also would like to set or read some items not defined in the *.h files. Can anyone point me to where the actual register access code is?
Thanks, Chris

RDA5807 Serial Frequency Display Problem & No RDS

When running the serial demo on an RDA5807, RDS information doesn't display at all (I have a digital receiver right next to my test unit showing the station RDS data).

Also, the Frequency in the terminal always displays 2 values, despite the tuner being tuned to a specific frequency I have specified and know the tuner is on:
FREQ:138.10 MHz
FREQ:138.10 MHz
FREQ:138.10 MHz
FREQ:138.10 MHz
FREQ:189.30 MHz
FREQ:189.30 MHz
FREQ:138.10 MHz
FREQ:189.30 MHz

Library not compiling on Arduino IDE (radio.cpp:426:16: error: 'class HardwareSerial' has no member named 'printf')

Hi I'm testing your code on Arduino IDE 1.8.10 and there are some errors when compiling:
radio.cpp:426:16: error: 'class HardwareSerial' has no member named 'printf'
radio.cpp:443:16: error: 'class HardwareSerial' has no member named 'printf'
radio.cpp:451:16: error: 'class HardwareSerial' has no member named 'printf'

I'm using your example code 'TestRDA5807M' with no modifications, and your library downloaded from github.

There are also many typedef declarations warnings, but the main problem is the code not compiling by the errors detailed.

Am I making some mistake or what could be the cause of this compiling errors?

Thank you in advance

Juan Luis

Rda5807 Lcd radio

Dear Sir, I am working on your code it's really interesting. I am using your Lcdradio library. My connections including rda5807m, Arduino Uno, Two push buttons, rotary encoder and 16×2 lcd display with PCF8574. I did all the connection correctly with some minor modifications in code as per my set up. But I found rotary encoder and seek button function not working. Only menu button works. I changed the A10, A11 values to A0 and A1 and rotary encoder value to A2 and A3. Still the same issue.
I really appreciate your work meanwhile i seek you help regarding this problem.

Thanks

(RT+) RadioText +

Hey, Thanks for the good work you have done here, Just wanted to ask if there is a radio text plus support on this library. Thanks again!

webradio webserver doesn't start

Hi,

I'm receiving errors like below. The ethernet shield seems to work but then the webserver doesn't start. I put the 3 web files on SD card without any additional directory. Not sure what I'm doing wrong.

12:19:04.656 -> >setFrequency(10000)
12:19:04.656 -> >_waitEnd()
12:19:04.732 -> >setMono(0)
12:19:04.767 -> >setMute(0)
12:19:04.767 -> >setVolume(6)
12:19:06.002 -> >Ethernet Result:1
12:19:06.002 -> >Configuration:
12:19:06.002 -> > localIP:192.168.3.109
12:19:06.002 -> > subnetMask:255.255.255.0
12:19:06.002 -> > dnsServerIP:192.168.3.1
12:19:06.002 -> > gatewayIP:192.168.3.1
12:19:06.002 -> >Starting the server...
12:19:06.002 -> >Free RAM:4153
12:19:06.002 -> 12850
12:19:06.002 -> >RDS:
12:19:06.035 -> >FREQ:100.00 MHz
12:19:06.281 -> >RDS:POWER FM
12:19:09.520 -> >RDS-text:
12:19:15.578 -> >RDS:POWER P⸮
12:19:15.890 -> >RDS-text:EN IYI EN YENI MUZIK
12:19:15.998 -> >RDS:POWER FM
12:19:16.356 -> 62282
12:19:16.427 -> 12850
12:19:17.912 -> >RDS-text:
12:19:26.314 -> >RDS-text:EN IYI EN YENI MUZIK
12:19:34.732 -> >RDS-text:EN IYI EN YENI MUZIK
12:19:43.131 -> >RDS-text:EN IYI EN YENI MUZIK
12:19:48.830 -> >RDS:POWER PO
12:19:49.180 -> >RDS:POWER FM
12:19:51.547 -> >RDS-text:EN IYI EN YENI MUZIK
12:19:58.640 -> >RDS-time:12:20
12:20:00.049 -> >RDS-text:EN IYI EN YENI MUZIK
12:20:08.451 -> >RDS-text:EN IYI EN YENI MUZIK
12:20:09.670 -> >respond404NotFound()

Any thoughts?

Porting for 8266

Having a hard time locating where the I2C address is set and where the pins are specified. Using the RDA5807 chip and NodeMCU.

rds.attachServicenNameCallback(DisplayServiceName);

This line fails after updating the radio.h library.
rds.attachServicenNameCallback(DisplayServiceName);

exit status 1
'class RDSParser' has no member named 'attachServicenNameCallback'

Where is the documentation for those changes?

LCDKEYPAD Radio

Hi,

Firstly thank you for the great work. Your code helped me tremendously.

I'm using the LCDKEYPAD code and I have a strange problem. When I press the UP key it acts like RIGHT key. On serial monitor the UP key shows as RIGHT key.

Have you experienced similar problem before.

Thanks
-Onur

Si4703 with esp32, screen goes white

Building a stationary radio with esp32 wroom 30 pin, and display ili 9488 3.5".
Problem is, that when the Si4703 radio module is initialized seconds later after the tft.ini(), the display goes all white.
It appears to react upon the touch, so it is somehow active. The reversing doesnt affect.
There is a spiffs calibration running if wanted, and it doesnt go white background when calibratrion is going on.
The latest tft_espi libs are not used, since someone said there was trouble with it, and this older version appears to work with lesser implementations.
How to solve the display issue?
Script is complicated, and attached as links.
dropbox arduino esp32 radio 2c - The script
https://www.dropbox.com/s/5jcuh6wvon71o4a/arduino_radio7_Si4703_V1_Tiny_RTC_copy2c.zip?dl=0

The tft_espi files
https://www.dropbox.com/s/arvvz5odn1p30hp/TFT_eSPI.zip?dl=0

And a picture:
https://www.dropbox.com/s/wdcw3mbrlspm6c4/radio2c.jpg?dl=0

Just noise LCDRadio SI7403

Hi there!
Build a LCDRadio with SI4703 a16x2LCD via I2C and a rotary enconder.
Platform is a Arduino nano clone 328p.
I used the LCD Radio Sketch as shown down.
System starts up. LCD is working(shows bandFM and menu like Vol or Mute etc.)
Rotary encoder: ONLY the switch is working.
Serial COM works also with commands .
Menu Button goes to A1. Since I dont have a seek Button i keep the code selection to A0.
Si4703 just produce noise. Even when stations are changed.
When i test it with Test4703 it works fine!
Can you please help me with this??
Thanks

Andreas

 My Pinout goes like this:
Arduino SI4703 sig LCD KY040 Rotary Encoder
GND (black) GND GND GND
3.3V (red) VCC - -
5V (red) - VCC VCC 5V
A5 (yellow) SCLK SCLK -
A4 (blue) SDIO SDIO -
D2 RST - -
A3 (white) - - DT
A2 (yellow) - - CLK
A1 (green) - - SW

Code is here!!! :

`///
/// \file LCDRadio.ino
/// \brief Radio implementation including LCD output.
///
/// \author Matthias Hertel, http://www.mathertel.de
/// \copyright Copyright (c) 2014 by Matthias Hertel.\n
/// This work is licensed under a BSD style license.\n
/// See http://www.mathertel.de/License.aspx
///
/// \details
/// This is a full function radio implementation that uses a LCD display to show the current station information.\n
/// It can be used with various chips after adjusting the radio object definition.\n
/// Open the Serial console with 57600 baud to see current radio information and change various settings.
///
/// Wiring
/// ------
/// The necessary wiring of the various chips are described in the Testxxx example sketches.
/// The boards have to be connected by using the following connections:
///
/// Arduino port | SI4703 signal | RDA5807M signal
/// :----------: | :-----------: | :-------------:
/// GND (black) | GND | GND
/// 3.3V (red) | VCC | VCC
/// 5V (red) | - | -
/// A5 (yellow) | SCLK | SCLK
/// A4 (blue) | SDIO | SDIO
/// D2 | RST | -
///
/// More documentation and source code is available at http://www.mathertel.de/Arduino
///
/// History:
/// --------
/// * 05.08.2014 created.
/// * 06.10.2014 working.

#include <Wire.h>

#include <radio.h>
#include <RDA5807M.h>
#include <SI4703.h>
#include <TEA5767.h>

#include <RDSParser.h>

#include <LiquidCrystal_PCF8574.h>

#include <RotaryEncoder.h>
#include <OneButton.h>

// Define some stations available at your locations here:
// 89.40 MHz as 8940

// RADIO_FREQ preset[] = {8850, 8930, 9320,9350, 9450,9570, 9680, 9880, 10030, 10260, 10400, 10500, 10600,10650,10800};

RADIO_FREQ preset[] = {
8770,
8810, // hr1
8820,
8850, // Bayern2
8890, // ???
8930, // * hr3
8980,
9180,
9220, 9350,
9440, // * hr1
9510, // - Antenne Frankfurt
9530,
9560, // Bayern 1
9680, 9880,
10020, // planet
10090, // ffh
10110, // SWR3
10030, 10260, 10380, 10400,
10500 // * FFH
};
// , 10650,10650,10800

int i_sidx=8; // Start at Station with index=19
int i_smax=30; // Max Index of Stations

/// Setup a RoraryEncoder for pins A2 and A3:
RotaryEncoder encoder(A2, A3);
// RotaryEncoder encoder(A9, A8);

int encoderLastPos;
unsigned long encoderLastTime;

// variables for rotator encoder
//unsigned long lastRotatorChange = 0; // last time a change of the rotator was detected.

/// The radio object has to be defined by using the class corresponding to the used chip.
/// by uncommenting the right radio object definition.

// RADIO radio; // Create an instance of a non functional radio.
// RDA5807M radio; // Create an instance of a RDA5807 chip radio
SI4703 radio; // Create an instance of a SI4703 chip radio.
// TEA5767 radio; // Create an instance of a TEA5767 chip radio.

/// The lcd object has to be defined by using a LCD library that supports the standard functions
/// When using a I2C->LCD library ??? the I2C bus can be used to control then radio chip and the lcd.

/// get a LCD instance
LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display

OneButton menuButton(A1, true);
OneButton seekButton(A0, true);

/// get a RDS parser
RDSParser rds;

/// State definition for this radio implementation.
enum RADIO_STATE {
STATE_NONE = 0,
STATE_PARSECOMMAND, ///< waiting for a new command character.
STATE_PARSEINT, ///< waiting for digits for the parameter.
STATE_EXEC, ///< executing the command.

STATE_FREQ,
STATE_VOL,
STATE_MONO,
STATE_SMUTE

};

RADIO_STATE state; ///< The state variable is used for parsing input characters.
RADIO_STATE rot_state;

// - - - - - - - - - - - - - - - - - - - - - - - - - -

/// Update the Frequency on the LCD display.
void DisplayFrequency(RADIO_FREQ f)
{
char s[12];
radio.formatFrequency(s, sizeof(s));
Serial.print("FREQ:"); Serial.println(s);
lcd.setCursor(0, 0);
lcd.print(s);
} // DisplayFrequency()

/// Update the ServiceName text on the LCD display when in RDS mode.
void DisplayServiceName(char *name)
{
Serial.print("RDS:"); Serial.println(name);
if (rot_state == STATE_FREQ) {
lcd.setCursor(0, 1);
lcd.print(name);
}
} // DisplayServiceName()

void DisplayTime(uint8_t hour, uint8_t minute) {
Serial.print("RDS-Time:");
if (hour < 10) Serial.print('0');
Serial.print(hour);
Serial.print(':');
if (minute < 10) Serial.print('0');
Serial.print(minute);
} // DisplayTime()

/// Display the current volume.
void DisplayVolume(uint8_t v)
{
Serial.print("VOL: "); Serial.println(v);

lcd.setCursor(0, 1);
lcd.print("VOL: "); lcd.print(v);
} // DisplayVolume()

/// Display the current mono switch.
void DisplayMono(uint8_t v)
{
Serial.print("MONO: "); Serial.println(v);
lcd.setCursor(0, 1);
lcd.print("MONO: "); lcd.print(v);
} // DisplayMono()

/// Display the current soft mute switch.
void DisplaySoftMute(uint8_t v)
{
Serial.print("SMUTE: "); Serial.println(v);
lcd.setCursor(0, 1);
lcd.print("SMUTE: "); lcd.print(v);
} // DisplaySoftMute()

// - - - - - - - - - - - - - - - - - - - - - - - - - -

void RDS_process(uint16_t block1, uint16_t block2, uint16_t block3, uint16_t block4) {
rds.processData(block1, block2, block3, block4);
}

// this function will be called when the menuButton was clicked
void doMenuClick() {
unsigned long now = millis();

if (rot_state == STATE_FREQ) {
// jump into volume mode
rot_state = STATE_VOL;
encoderLastPos = radio.getVolume();
encoder.setPosition(encoderLastPos);
DisplayVolume(encoderLastPos);

}
else if (rot_state == STATE_VOL) {
// jump into mono/stereo switch
rot_state = STATE_MONO;
encoderLastPos = radio.getMono();
encoder.setPosition(encoderLastPos);
DisplayMono(encoderLastPos);

}
else if (rot_state == STATE_MONO) {
// jump into soft mute switch
rot_state = STATE_SMUTE;
encoderLastPos = radio.getSoftMute();
encoder.setPosition(encoderLastPos);
DisplaySoftMute(encoderLastPos);

}
else if (rot_state == STATE_SMUTE) {
rot_state = STATE_FREQ;
encoderLastPos = (radio.getFrequency() - radio.getMinFrequency()) / radio.getFrequencyStep();
encoder.setPosition(encoderLastPos);
DisplayServiceName("...");

} // if
encoderLastTime = now;

} // doMenuClick()

// this function will be called when the seekButton was clicked
void doSeekClick() {
Serial.println("SEEK...");
radio.seekUp(true);
} // doSeekClick()

// The Interrupt Service Routine for Pin Change Interrupts
// On Arduino UNO you can use the PCINT1 interrupt vector that covers digital value changes on A2 and A3.
// On Arduino Mega 2560 you can use the PCINT2 interrupt vector that covers digital value changes on A8 and A9.
// Read http://www.atmel.com/Images/doc8468.pdf for more details on external interrupts.

ISR(PCINT2_vect) {
encoder.tick(); // just call tick() to check the state.
} // ISR for PCINT2

/// Setup a FM only radio configuration with I/O for commands and debugging on the Serial port.
void setup() {
// open the Serial port
Serial.begin(57600);

// Initialize the lcd
lcd.begin(16, 2);
lcd.setBacklight(1);
lcd.print("Hallo Du!!!");

delay(1200);
lcd.clear();

// Initialize the Radio
radio.init();

// Enable information to the Serial port
radio.debugEnable();

// radio.setBandFrequency(RADIO_BAND_FM, 8930); // hr3
radio.setBandFrequency(RADIO_BAND_FM, preset[i_sidx]); // 5. preset.
// radio.setFrequency(10140); // Radio BOB // preset[i_sidx]

// Setup rotary encoder

// You may have to modify the next 2 lines if using other pins than A2 and A3
// On Arduino-Uno: rotary encoder in A2(PCINT10) and A3(PCINT11)
// PCICR |= (1 << PCIE1); // This enables Pin Change Interrupt 1 that covers the Analog input pins or Port C.
// PCMSK1 |= (1 << PCINT10) | (1 << PCINT11); // This enables the interrupt for pin 2 and 3 of Port C.

// On Arduino-MEGA2560: A8(PCINT16) and A9(PCINT17) for interrupt vector PCINT2
PCICR |= (1 << PCIE2);
PCMSK2 |= (1 << PCINT16) | (1 << PCINT17);

encoderLastPos = (radio.getFrequency() - radio.getMinFrequency()) / radio.getFrequencyStep();
Serial.println(encoderLastPos);
encoder.setPosition(encoderLastPos);

// Setup the buttons
// link the doMenuClick function to be called on a click event.
menuButton.attachClick(doMenuClick);

// link the doSeekClick function to be called on a click event.
seekButton.attachClick(doSeekClick);

delay(100);

radio.setMono(false);
radio.setMute(false);
//radio.debugRegisters();

Serial.write('>');

state = STATE_PARSECOMMAND;
rot_state = STATE_NONE;

// setup the information chain for RDS data.
radio.attachReceiveRDS(RDS_process);

rds.attachServicenNameCallback(DisplayServiceName);

rds.attachTimeCallback(DisplayTime);

} // Setup

/// Execute a command identified by a character and an optional number.
/// See the "?" command for available commands.
/// \param cmd The command character.
/// \param value An optional parameter for the command.
void runCommand(char cmd, int16_t value)
{
if (cmd == '?') {
Serial.println();
Serial.println("? Help");
Serial.println("+ increase volume");
Serial.println("- decrease volume");
Serial.println("> next preset");
Serial.println("< previous preset");
Serial.println(". scan up : scan up to next sender");
Serial.println(", scan down ; scan down to next sender");
Serial.println("fnnnnn: direct frequency input");
Serial.println("i station status");
Serial.println("s mono/stereo mode");
Serial.println("b bass boost");
Serial.println("m mute/unmute");
Serial.println("u soft mute/unmute");
}

// ----- control the volume and audio output -----

else if (cmd == '+') {
// increase volume
int v = radio.getVolume();
if (v < 15) radio.setVolume(++v);
}
else if (cmd == '-') {
// decrease volume
int v = radio.getVolume();
if (v > 0) radio.setVolume(--v);
}

else if (cmd == 'm') {
// toggle mute mode
radio.setMute(! radio.getMute());
}

else if (cmd == 'u') {
// toggle soft mute mode
radio.setSoftMute(! radio.getSoftMute());
}

// toggle stereo mode
else if (cmd == 's') { radio.setMono(! radio.getMono()); }

// toggle bass boost
else if (cmd == 'b') { radio.setBassBoost(! radio.getBassBoost()); }

// ----- control the frequency -----

else if (cmd == '>') {
// next preset
if (i_sidx < (sizeof(preset) / sizeof(RADIO_FREQ))-1) {
i_sidx++; radio.setFrequency(preset[i_sidx]);
} // if
}
else if (cmd == '<') {
// previous preset
if (i_sidx > 0) {
i_sidx--;
radio.setFrequency(preset[i_sidx]);
} // if

}
else if (cmd == 'f') { radio.setFrequency(value); }

else if (cmd == '.') { radio.seekUp(false); }
else if (cmd == ':') { radio.seekUp(true); }
else if (cmd == ',') { radio.seekDown(false); }
else if (cmd == ';') { radio.seekDown(true); }

// not in help:
else if (cmd == '!') {
if (value == 0) radio.term();
if (value == 1) radio.init();

}
else if (cmd == 'i') {
char s[12];
radio.formatFrequency(s, sizeof(s));
Serial.print("Station:"); Serial.println(s);
Serial.print("Radio:"); radio.debugRadioInfo();
Serial.print("Audio:"); radio.debugAudioInfo();

// Serial.print(" RSSI: ");
// Serial.print(info.rssi);
//
// for (uint8_t i = 0; i < info.rssi - 15; i+=2) { Serial.write('*'); } // Empfangspegel ab 15. Zeichen
// Serial.println();
} // info
// else if (cmd == 'n') { radio.debugScan(); }
else if (cmd == 'x') { radio.debugStatus(); }

} // runCommand()

/// Constantly check for serial input commands and trigger command execution.
void loop() {
int newPos;
unsigned long now = millis();
static unsigned long nextFreqTime = 0;
static unsigned long nextRadioInfoTime = 0;

// some internal static values for parsing the input
static char command;
static int16_t value;
static RADIO_FREQ lastf = 0;
RADIO_FREQ f = 0;
char c;

// check for the menuButton
menuButton.tick();

if (Serial.available() > 0) {
// read the next char from input.
c = Serial.peek();

if ((state == STATE_PARSECOMMAND) && (c < 0x20)) {
  // ignore unprintable chars
  Serial.read();

}
else if (state == STATE_PARSECOMMAND) {
  // read a command.
  command = Serial.read();
  state = STATE_PARSEINT;

}
else if (state == STATE_PARSEINT) {
  if ((c >= '0') && (c <= '9')) {
    // build up the value.
    c = Serial.read();
    value = (value * 10) + (c - '0');
  }
  else {
    // not a value -> execute
    runCommand(command, value);
    command = ' ';
    state = STATE_PARSECOMMAND;
    value = 0;
  } // if
} // if

} // if

// check for the rotary encoder
newPos = encoder.getPosition();
if (newPos != encoderLastPos) {

if (rot_state == STATE_FREQ) {
  RADIO_FREQ f = radio.getMinFrequency() + (newPos *  radio.getFrequencyStep());
  radio.setFrequency(f);
  encoderLastPos = newPos;
  nextFreqTime = now + 10;

}      
else if (rot_state == STATE_VOL) {
  radio.setVolume(newPos);
  encoderLastPos = newPos;
  DisplayVolume(newPos);
  
}
else if (rot_state == STATE_MONO) {
  radio.setMono(newPos & 0x01);
  encoderLastPos = newPos;
  DisplayMono(newPos & 0x01);

}
else if (rot_state == STATE_SMUTE) {
  radio.setSoftMute(newPos & 0x01);
  encoderLastPos = newPos;
  DisplaySoftMute(newPos & 0x01);

} // if
encoderLastTime = now;

}
else if (now > encoderLastTime + 2000) {
// fall into FREQ + RDS mode
rot_state = STATE_FREQ;
encoderLastPos = (radio.getFrequency() - radio.getMinFrequency()) / radio.getFrequencyStep();
encoder.setPosition(encoderLastPos);

} // if

// check for RDS data
radio.checkRDS();

// update the display from time to time
if (now > nextFreqTime) {
f = radio.getFrequency();
if (f != lastf) {
// don't display a Service Name while frequency is no stable.
DisplayServiceName(" ");
DisplayFrequency(f);
lastf = f;
} // if
nextFreqTime = now + 400;
} // if

if (now > nextRadioInfoTime) {
RADIO_INFO info;
radio.getRadioInfo(&info);
lcd.setCursor(14, 0);
lcd.print(info.rssi);
nextRadioInfoTime = now + 1000;
} // update

} // loop

// End.`

New Arduino IDE doesn't compile the Examples

I'm trying to compile the examples of the Radio library without any success
There are a lot of errors in the library probably because the Arduino IDE has been updated after revision 1.6 with changes not compatible with this library
E.g. Arduino.h is not yet required, RADIO.h and radio.h are different, etc.
@mathertel please could you update the library to be compatible with the new Arduino IDEs
Thank you
Gio

Hint for RDSParser.cpp

Hello Matthias,
Thank you for the very nice Library. I have the ELVRADIO and testing the RDSText.
In RDSTEXT it will replace characters with ']', but no Errors.
I comment out the two lines in rdsparser.cpp

// p = strchr(_RDSText, '\0x0D');
// if (p) *p = ']';

Now, have i text without ']'.

The accuracy of the RDSTEXT and the Stationname like it. (si4705)
Is it so exactly at the si4703?

ClashC

declaration typedef struct AUDIO_INFO

\libraries\Radio-master\src/radio.h:128:1: warning: 'typedef' was ignored in this declaration

typedef struct AUDIO_INFO {

^~~~~~~

How to get around this warning?

Si4703 extended volume range

The Si4703 has a configuration bit for extending the volume range, essentially offering 16 additional lower volume levels. Would it be possible to add support for setting this bit? I find the lowest regular volume setting uncomfortably loud on the Si4703 breakout board I have (sparkfun clone).

The bit is called VOLEXT and is present in register 06 = SYSCONFIG3. My suggestion would be to offer more audio level settings and handle the VOLEXT bit in the setVolume function.

'va_list' error

This error was already called out by cashC in 2016. Same error for me with An Adafruit M0 board for an RDA5807m.... adding the stdarg.h in radio.h fixed the error per below comment... thank you!

add "#include <stdarg.h>" in radio.h after #include <Wire.h>. Otherwise the error comes Error:
"'va_list' was not declared in this scope".

Code polls for STC bit using I2C instead of waiting for interrupt on GPIO2

The datasheet https://media.digikey.com/pdf/Data%20Sheets/Silicon%20Laboratories%20PDFs/Si4703-B16.pdf says on page 17:

The Si4703-B16 seek/tune performance may be affected by data activity on the SDIO bus when using the integrated internal oscillator. SDIO activity results from polling the tuner for status or communicating with other devices that share the SDIO bus. If there is SDIO bus activity while the Si4703-B16 is performing the seek/tune function, the crystal oscillator may experience jitter, which may result in mistunes and/or false stops.
SDIO activity during all other operational states does not affect performance.
For best seek/tune results, Silicon Laboratories recommends that all SDIO data traffic be suspended during Si4703-B16 seek and tune operations. This is achieved by keeping the bus quiet for all other devices on the bus, and delaying tuner polling until the tune or seek operation is complete. The STC (seek/tune complete) interrupt should be used instead of polling to determine when a seek/tune operation is complete.

This project violates this recommendation as https://github.com/mathertel/Radio/blob/master/src/SI4703.cpp#L510 shows.

Are there plans to remedy this?

SI4703 hanging at Function setFrequency()

Hello, I bought two breakout modules for Si4703 from Makershop.de. When testing with your
Zwischenablagebild
library I have the following problem. In every example sketch, the software hangs when I call the setFrequency() function. I tried the examples with Arduino pro mini, with ESP8266 (D1 mini) and with ESP32. Same problem every time. When calling setFrequency(), the Sketch stops at _waitEnd(). I would be very grateful for a tip as to the cause of the problem.

suggestion: Decoding the date information with MJD!

Hello,
I use for my project the decoding of the date information about MJD.
This information i have from here: http://pic-projekte.de/phpBB3/viewtopic.php?f=14&p=7475&#p7458
Maybe you like it too? :)

Example:

void DisplayTime(uint8_t hour, uint8_t minute, uint32_t mjd) {
  //SetRTCTime(hour, minute);
  setRTCdatefromMJD(mjd);
} // DisplayTime()
...
void setRTCdatefromMJD(uint32_t mjd)
{
  int k;

  int _year = (int) ((mjd - 15078.2) / 365.25);
  int _month = (int) ((mjd - 14956.1 - (int)(_year * 365.25)) / 30.6001);
  int _date = (int) (mjd - 14956 - (int)(_year * 365.25) - (int)(_month * 30.6001));

  k = (_month == 14 || _month == 15) ? 1 : 0;
  _year = _year + k;
  _month = _month - 1 - k * 12;
  //_month--;

  long WD=(long)((mjd+2) % 7)+1; //modulo 7 | Day of the Week
... Code ...
}

Patch:

--- ./src/RDSParser.cpp 2016-12-22 21:55:19.647046114 +0100
+++ ./src-neu/RDSParser.cpp     2016-12-17 13:06:56.000000000 +0100
@@ -58,6 +58,7 @@

   uint16_t mins; ///< RDS time in minutes
   uint8_t off;   ///< RDS time offset and sign
+  uint32_t MJD;

   // Serial.print('('); Serial.print(block1, HEX); Serial.print(' '); Serial.print(block2, HEX); Serial.print(' '); Serial.print(block3, HEX); Serial.print(' '); Serial.println(block4, HEX);

@@ -150,7 +151,14 @@
     off = (block4)& 0x3F; // 6 bits
     mins = (block4 >> 6) & 0x3F; // 6 bits
     mins += 60 * (((block3 & 0x0001) << 4) | ((block4 >> 12) & 0x0F));
+
+       // und jetzt modifiziertes julianisches Datum berechnen
+       MJD=(block3 >>1);                                       //rechts schieben, da Bit0 nicht relevant ist
+       MJD=(MJD|0x4000) | ((block2 & 0x1)<<14);                //Bit 0 von Block B wird Bit15 in MJD
+       MJD=(MJD|0x8000) | ((block2 & 0x2)<<15);                //Bit 1 con Block B wird Bit16 in MJD
+
     // adjust offset
     if (off & 0x20) {
       mins -= 30 * (off & 0x1F);
@@ -160,7 +168,7 @@

     if ((_sendTime) && (mins != _lastRDSMinutes)) {
       _lastRDSMinutes = mins;
-      _sendTime(mins / 60, mins % 60);
+      _sendTime(mins / 60, mins % 60, MJD);
     } // if
     break;

diff -Nur ./src/RDSParser.h ./src-neu/RDSParser.h
--- ./src/RDSParser.h   2016-12-22 21:55:19.647046114 +0100
+++ ./src-neu/RDSParser.h       2016-12-17 12:52:22.000000000 +0100
@@ -28,7 +28,7 @@
 extern "C" {
   typedef void(*receiveServicenNameFunction)(char *name);
   typedef void(*receiveTextFunction)(char *name);
-  typedef void(*receiveTimeFunction)(uint8_t hour, uint8_t minute);
+  typedef void(*receiveTimeFunction)(uint8_t hour, uint8_t minute, uint32_t MJD);
 }

--- ./src/radio.h       2016-12-22 21:55:19.653046114 +0100
+++ ./src-neu/radio.h   2016-12-04 13:49:26.000000000 +0100
@@ -54,6 +54,7 @@

 #include <Arduino.h>
 #include <Wire.h>
+#include <stdarg.h>

SimpleRadio doesnt compile in master branch

Did not spot that branch feature-4721 is tagged as latest. Got confused when symlinking the Arduino IDE.

looking like you're using master as WIP. Shouldn't you be using a feature branch?

Si4703 on Nano Atmega328P write fail

Hello,
i'm facing following problem with my setup:

Radio...
>init()
Write Fail:2
Write Fail:2
>setBand(1)
>setFrequency(8930)
Write Fail:2
>_waitEnd()
>Seek limit hit
Write Fail:2

I've tried with different libs. I can read (try to read) rds data or change the volume value but any channel operation hangs. What could be the problem? Do i need a level shifter on a4,a5,d2 for Nano?

Regards,
Gena

Doesn't work with SI4703

It seems that the init cannot complete as the " while(Wire.available() < 32) ;" keeps hanging on 0... Wire.available() is always zero... What might be wrong?

Si7403 #define IN_EUROPE hardcoded

For Si4703, the region setting is hardcoded:

#define IN_EUROPE

Would it be possible to make this configurable? The European spacing (100 kHz) is finer than the US spacing (200 kHz), so US stations can still be tuned. The IN_EUROPE flag also forces the European de-emphasis setting of 50 us.

Related: would it be possible to support the Japanese FM band 76–95 MHz ?

Si4721 TxRx

How would you feel about a pull request that adds transmit support via Si4721?

I'm releasing an Si4721 breakout and I'm trying to decide whether to write a library or just add support to yours. I used your library to test the FM+RDS receive function since the 472x share a command set with the 4705. It works like a dream.

Doesn't works

Hi
First, thx for your work
I've this TEA5767 from here:
http://fr.aliexpress.com/item/TEA5767-FM-Stereo-Radio-Module-for-Arduino-76-108MHZ-With-Free-Cable-Antenna/32285486392.html?adminSeq=201112132&isOrigTitle=true&shopNumber=110055
It's connected to the arduino uno, and i upload the sketch with the arduino ide 1.6.3 and it doesn't works. Everytime there is just noise and for TestTEA5767 i've this:

Radio...
setFrequency(9540)
*11672
Write Fail:2
setVolume()
setMono()
Write Fail:2
Station:362.58 MHz
Radio: --- ----- MONO RSSI: 0
Audio: ---- ---- --------
Station:362.58 MHz
Radio: --- ----- MONO RSSI: 0
Audio: ---- ---- --------
Station:362.58 MHz
Radio: --- ----- MONO RSSI: 0
Audio: ---- ---- --------
Station:362.58 MHz
Radio: --- ----- MONO RSSI: 0
Audio: ---- ---- --------
Station:362.58 MHz
Radio: --- ----- MONO RSSI: 0
Audio: ---- ---- --------

I tried with others library and no one works, there is just 1 time it switched on a radio and it was very clear, i tried to change again but no succes, i think it was just chance.
I noticed in the noise we can hear the keyboard and sometimes the arduino when it send data to the computer.
Maybe it come from the arduino version ?

Always says the frequency is 189.30 on TestRDA5807M

Hello,

I have tried two different microcontrollers (ESP-8266 and Feather 32u4 Bluefruit) with the standard setup. When I run the TestRDA5807M sample code, it says it's tuning it to 89.30, but when it shows the frequency, it's set to 189.30. I've tried other stations (such as 106.5 which is a huge station where I live) and it always shows 189.30.

I'm making no changes to the code other than the initial frequency on line 43.

My "standard setup" is to connect SDA, SCL, VCC and GND to the microcontrollers. I've tried 1k, 2.2k, 10k and no external pull-up resistors on SDA and SCL. I2C scans with no pull-ups and 1k pull-ups don't recognize the device, but both 2.2k and 10k pull-ups show a device on 0x10.

I'm at a loss for what I'm doing wrong. I'm aware this probably isn't enough information and I'm ready to offer whatever information I may have missed.

I'd consider myself a somewhat experienced person when it comes to general Arduino IDE programming and circuitry, but I know I'm not the most knowledgeable and probably missed some stuff along the way.

Thanks in advance. \

SNR and CNT functions not working with Si4703

Hi,
Thanks for the great library! I am using an Si4703 with an Arduino Uno. The RSSI functionality works great but there seems to be a problem with the SNR. It always shows 0. Have you disabled it by any chance? If yes, how do you enable it? I would also appreciate if you could tell me how to access the SKCNT data.

si4703 attrackting si4705 script

Arduino scripts\libraries\Radio-master\src\SI4705.cpp:498:25: note: within this loop

for (uint8_t n = 0; n < 12; n++) {

Its just that the radio is a SI4703, and there is a script dedicated the SI4703, and the compiler is complaining about an error, from a script there should not be picked at. SI4705 is not mentioned at all in the IDE script!

SI4703

Hi,
I ran an example on the ESP32 ScanRadio.ino
but only noise is heard, when scanning, it catches nothing.
my settings
#ifdef ESP32
int resetPin =19; // rst
int SDIO = 21; //sda
int SCLK = 22; //scl
int STC = 18; //gpio2
#endif //ESP32
SI4703 radio(resetPin,SDIO);

in setup
#ifdef ESP32
Wire.begin(SDIO, SCLK);
#endif
the library from SparkFun works well.
Advise what can be done, the library is good because universal, thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.