Giter Club home page Giter Club logo

sdrppcontroller's Introduction

sdrppcontroller

Arduino SDR++ Controller

Arduino sketch + Linux and Windows plugin

VIDEO Youtube video

Introduction

I was inspired by a question asked on RTL-SDR Facebook group. Although this question was about controlling SDR# with Arduino I decided to give a try with SDR++. I took a look at rig_ctrl plugin, but it was missing some gui functionalities. Also this plugin was designed to controll the software via network and its purpose in general was quite different from what I wanted to achieve. That's why I decided to try something by my own. Parts of the code were taken from Botland store and DRFrobot wiki. Serial initialization was googled and found in some Stackoverlow answer (hopefully). I just glued those pieces toghether. Please note: I'm not a software developer and I'm not a very big fan of C++. Yet, I manged to develop something functional,so here it is: "Arduino SDR++ Controller"

Environment

Building

In order to build the plugin please follow the instructions from SDR++ README file. Use Arduino IDE to compile the sketch and upload to the board.

  • Arduino/controller_uno/controller_uno.ino - Arduino UNO code
  • Arduino/controller_leonardo/controller_leonardo.ino - Arduino Leonardo code
  • Plugin/misc_modules/arduino_controller/src/main.cpp - plugin code

Wiring for Arduino UNO

Rotary encoders are connected to digitial pins:

"Left" knob:

  • Hole A -> Pin 13 - left turn
  • Hole B -> Pin 12 - right turn
  • Hole C -> Pin 11 - button

"Right" knob:

  • Hole A -> Pin 3 - left turn
  • Hole B -> Pin 2 - right turn
  • Hole C -> Unused - because the shield was out of digital pins

Wiring for Arduino Leonardo

Rotary encoders are connected to digitial pins:

"Left" knob:

  • Hole A -> Pin 2 - left turn
  • Hole B -> Pin 3 - right turn
  • Hole C -> Pin 11 - button

"Right" knob:

  • Hole A -> Pin 0 - left turn
  • Hole B -> Pin 1 - right turn
  • Hole C -> Unused (for now)

Connecting to PC

Connect Arduino with standard USB cable. It should be registered as a serial device, for example: /dev/ttyACM0.

LCD Keys mapping

  • Left , Right - Waterfall Zoom In / Zoom Out
  • Up , Down - Tune with a step equals to device sample rate.
  • Select - Cycle demodulators.
  • Left knob - Tune with a step equals to "Snap interval" multiplied by 10.
  • Right knob - Tune with a step equals to "Snap interval".
  • Knob button - Center waterfall.

Usage

Enable the plugin with "Module Manager". Setup serial port (default: /dev/ttyACM0) and click "Start" button.

License

SDR++ is GPL3.0 so if someone decides to include this plugin within SDR++ then the same license should be applied. Keep in mind that I used some code snippets from Botland store and DFRobot wiki. I didn't notice any licenses there. So, to conclude: I really do not care. Take this code and Do whatever you want.

Where to buy?

I bought everything at Botland.

Multiplatform Serialib

Multiplatform serial communication done with Serialib by Philippe Lucidarme. Accoriding to author this library is license-free.

Final words

There is a lot of space for improments. For example I couldn't use interrupts for knobs because Arduino UNO has only two of them and I needed four. I read digital pins in a loop which is not the best practice I suppose. This issue doesn't affect Arduino Leonardo. Feel free to contribute. Greetings go to RTL-SDR Polska Facebook group and specially to Kacper for inspiring me!

sdrppcontroller's People

Contributors

d3cker avatar

Stargazers

AriESQ avatar  avatar  avatar  avatar AlexandreRouma avatar Gerad Munsch avatar  avatar Tom Van den Bon avatar BG7JAF avatar  avatar > GayCookie ✌ avatar

Watchers

Gerad Munsch avatar  avatar

Forkers

tomvdb

sdrppcontroller's Issues

How to compile for Mac?

Hi,
I am looking for conmile plugin on Mac with M1 SoC, where can I find detailed tutorial.
73

Request for a code update

I just dug up your project from last year. Unfortunately, at the same time, the SDR++ project evolved a bit and in the current version v1.1.0 sdrppcontroller does not compile correctly. Compiling under Ubuntu 22.04 (and for Ubuntu) ends with the following messages:
...
[ 92%] Built target radio
[ 93%] Building CXX object misc_modules/arduino_controller/CMakeFiles/arduino_controller.dir/src/main.cpp.o
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp: In member function ‘void ArduinoController::checkCommand(char*)’:
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp:169:33: error: ‘signalPath’ is not a member of ‘sigpath’
169 | double srate = sigpath::signalPath.getSampleRate();
| ^~~~~~~~~~
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp: In member function ‘void ArduinoController::readArduino()’:
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp:256:13: error: ‘spdlog’ has not been declared
256 | spdlog::info("Error reading: {0}", strerror(errno));
| ^~~~~~
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp:262:17: error: ‘spdlog’ has not been declared
262 | spdlog::info(">> {0}", commandReady);
| ^~~~~~
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp:265:21: error: ‘spdlog’ has not been declared
265 | spdlog::info(">> Received first line");
| ^~~~~~
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp: In member function ‘void ArduinoController::disconnectArduino()’:
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp:342:9: error: ‘spdlog’ has not been declared
342 | spdlog::info("Disconnect Arduino");
| ^~~~~~
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp: In member function ‘void ArduinoController::connectArduino()’:
/home/kmp/SDRPlusPlus/misc_modules/arduino_controller/src/main.cpp:349:13: error: ‘spdlog’ has not been declared
349 | spdlog::info("Error connecting to Arduino");
| ^~~~~~
make[2]: *** [misc_modules/arduino_controller/CMakeFiles/arduino_controller.dir/build.make:76: misc_modules/arduino_controller/CMakeFiles/arduino_controller.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1638: misc_modules/arduino_controller/CMakeFiles/arduino_controller.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

So a big request for a code update. PLEASE!

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.