stephensworld Posted October 4, 2015 Share Posted October 4, 2015 Hi,is it possible to set the PTT and get the status if someone is talking for example on terminal or with script?Background: We would like to connect two or more amateur radio repeaters. We don't want to use VOX because there is too much delay and we have the possibility to get the information if someone is talking on the repeater.If someone ist talking on repeater 1 I get a high level on gpio or rs232 and the mumble client should set the PTT and send the audio. On the other side repeater 2 see that someone is talking on mumble. So mumble should set a gpio to high and repeater 2 goes on air.Thank you very much.Stephan Link to comment Share on other sites More sharing options...
stephensworld Posted October 18, 2015 Author Share Posted October 18, 2015 (edited) Hi,thank you to hacst who helped me to find a solution.Stephan apt-get install build-essential pkg-config qt5-default libqt5svg5-dev \ libboost-dev libasound2-dev libssl-dev \ libspeechd-dev libzeroc-ice-dev libpulse-dev \ libcap-dev libprotobuf-dev protobuf-compiler \ libogg-dev libavahi-compat-libdnssd-dev libsndfile1-dev \ libg15daemon-client-dev libxi-dev qttools5-dev-tools mesa-common-dev on raspberry pi2 i had to extend the swap file sudo su -c 'echo "CONF_SWAPSIZE=2048" > /etc/dphys-swapfile' sudo dphys-swapfile setup sudo dphys-swapfile swapon get mumble source git clone https://github.com/mumble-voip/mumble.git git submodule init git submodule update add this line in main.pro LIBS = -lwiringPi -lwiringPiDev new public slot in MainWindow.hadd it in public slots: void onGpioPoll(); MainWindow.cpp #include <wiringPi.h> MainWindow.cpp void MainWindow::onGpioPoll() { static bool pttGpioPrevState = false; static bool pttGpioState = false; if (digitalRead(25)==1) { pttGpioState=true; } if (digitalRead(25)==0) { pttGpioState=false; } if (pttGpioState != pttGpioPrevState) { on_PushToTalk_triggered(pttGpioState, QVariant()); pttGpioPrevState = pttGpioState; } QList<ClientUser *> talkingUsers = ClientUser::getTalking(); // For someone else to be talking we have to be connected to the //server and there must be at least one person talking that isn't ourselves static bool pttPrev = false; const bool someoneElseTalking = g.sh && !(talkingUsers.empty() || (talkingUsers.size() == 1 && g.uiSession == talkingUsers.first()->uiSession)); if (someoneElseTalking) { if(!pttPrev){ digitalWrite(10, 1); pttPrev=true; } } if(!someoneElseTalking){ if (pttPrev){ digitalWrite(10, 0); pttPrev=false; } } } add the following in MainWindow.cpp in MainWindow::MainWindow(QWidget *p) QTimer *gpioPollingTimer = new QTimer(this); connect(gpioPollingTimer, SIGNAL(timeout()), this, SLOT(onGpioPoll())); gpioPollingTimer->start(100); // 100ms polling Intervall main.cpp #include <wiringPi.h> main.cpp in the int main(int argc, char **argv) function wiringPiSetupSys(); pinMode(10,OUTPUT); pinMode(25,INPUT); Compiling from mumble directory qmake -recursive main.pro CONFIG+="no-g15 no-server" LIBS+="-lwiringPi" make you also need a small shell scrip to set gpio pins.this worked for me:create file gpio.sh #!/bin/sh echo "10" > /sys/class/gpio/export echo "25" > /sys/class/gpio/export echo "in" > /sys/class/gpio/gpio25/direction echo "out" > /sys/class/gpio/gpio10/direction chmod 666 /sys/class/gpio/gpio10/value chown pi /sys/class/gpio/gpio25/value chmod 666 /sys/class/gpio/gpio10/direction chown pi /sys/class/gpio/gpio25/direction I start the script in /etc/rc.local automatically. Otherwise you have to start it manually as root after every rebootsudo ./gpio.shPlease see to find the correct gpio pin.http://raspberrypiguide.de/howtos/raspberry-pi-gpio-how-to/It is GPIO10 and GPIO25 or Wiring 12 and Wiring 6.73 Stephan, DL4STE Edited September 16, 2017 by stephensworld Link to comment Share on other sites More sharing options...
freakbeat Posted December 2, 2015 Share Posted December 2, 2015 Hello, did the code work?? do you have it compiled? how i can get a copy of it? i would like to try on a radio-LINKthanks Link to comment Share on other sites More sharing options...
stephensworld Posted December 3, 2015 Author Share Posted December 3, 2015 Yes it is working. We use it on the 2m repeater DB0FFLI have a compiled version for Raspberry 2.Stephan, DL4STE Link to comment Share on other sites More sharing options...
freakbeat Posted December 3, 2015 Share Posted December 3, 2015 Stephan, can you give me some clues on this?? i have a little knowledge about linux and C++, tell me if i'm right, do you built the environment to compile mumble? then you modified the files MainWindow.cpp MainWindow.h and main.cpp and after that did you compile the code? let me know if you can share the modified files and help me compiling under Pi 2.thanks Link to comment Share on other sites More sharing options...
freakbeat Posted December 3, 2015 Share Posted December 3, 2015 Another question, on the INPUT pin what do you connect? i can see that the OUTPUT is to activate the TX on the repeaters but i don't know if using only for radio link i need to take out from the code. Link to comment Share on other sites More sharing options...
stephensworld Posted December 6, 2015 Author Share Posted December 6, 2015 (edited) I did the following stepsyou need to install some development packages: apt-get install build-essential pkg-config qt4-dev-tools libqt4-dev libspeex1 \ libspeex-dev libboost-dev libasound2-dev libssl-dev g++ \ libspeechd-dev libzeroc-ice-dev ice-slice libpulse-dev slice2cpp \ libcap-dev libspeexdsp-dev libprotobuf-dev protobuf-compiler \ libogg-dev libavahi-compat-libdnssd-dev libsndfile1-dev \ libg15daemon-client-dev libxi-dev for more information please see http://wiki.mumble.info/wiki/BuildingLinux git clone https://github.com/mumble-voip/mumble.git you have to edit the source files as shown above.on the raspberry 2 I compiled with the following commands qmake -recursive main.pro CONFIG+="qt4-legacy-compat no-g15 no-server" LIBS+="-lwiringPi" make If you have any further questions don't hesitate to contact me.The solution is great. We have many users on the repeater with mumble. Our next step is to connect two or more repeater. Edited April 11, 2016 by stephensworld Link to comment Share on other sites More sharing options...
freakbeat Posted December 7, 2015 Share Posted December 7, 2015 Nice, i will try!! just another question, the INPUT PIN 25 where it goes?? i know the output is for put the repeater on TX and send the audio but the input pin? i don't get it. thanks Link to comment Share on other sites More sharing options...
stephensworld Posted December 7, 2015 Author Share Posted December 7, 2015 With the input pin you can set the mumble PTT in direction repeater receiver to mumble.You do not have to use the mumble vox. So you can reduce the delay. Link to comment Share on other sites More sharing options...
Nonolivier Posted January 19, 2016 Share Posted January 19, 2016 Hello, I have post the same question few month ago.I complete the request if someone feels the soul to develop.In the left column we would like to add a section "radio bridge".1. generalityIn this section on the right window, you can enable or disable the PTT feature.If enabled, you must be able to choose between a GPIO for raspberry or Send a message to a COM port or a sinusoidal signal on the left or right channel of the sound card.2. How to PTTFor the GPIO should be able to choose the number of GPIO.For the COM port should be selected COM port and send the message for transmission of activation and the message to stop transmission.For sinusoidal no particular things set apart which will be sent to the maximum level that can go out the sound card (1v ridge to ridge).3. Secondary functionsa) TOTThen we should have a TOT function (stop talker) which limits the time the relay is transmitting.b) delaysThere should be minimal delay before activating the transmission, to avoid tripping intenpestifs (value set in the window, but by default 500ms).Finally, it should have a minimum time after the end of discution that the relay does not stop intenpestivement (value set in the window, but by default 500ms).Thank you in advance if the soul of a friendly developer wants to contribute to our efforts.Several team of amateur radio or CB enthusiasts create parallel communication networks thanks to that, but we do not have enough developers. Link to comment Share on other sites More sharing options...
hamie Posted January 24, 2016 Share Posted January 24, 2016 (edited) I would like to get a copy if possible for use on my local ham repeater. I've got a rpi2 laying around! Edited April 21, 2016 by hamie Link to comment Share on other sites More sharing options...
stephensworld Posted January 25, 2016 Author Share Posted January 25, 2016 @hamie: I send you an email Link to comment Share on other sites More sharing options...
Grandpa-G Posted February 26, 2016 Share Posted February 26, 2016 Could I contact you for some private conversations about your work? I did the following stepsyou need to install some development packages: apt-get install build-essential pkg-config qt4-dev-tools libqt4-dev libspeex1 \ libspeex-dev libboost-dev libasound2-dev libssl-dev g++ \ libspeechd-dev libzeroc-ice-dev ice-slice libpulse-dev slice2cpp \ libcap-dev libspeexdsp-dev libprotobuf-dev protobuf-compiler \ libogg-dev libavahi-compat-libdnssd-dev libsndfile1-dev \ libg15daemon-client-dev libxi-dev for more information please see http://wiki.mumble.info/wiki/BuildingLinux git clone https://github.com/mumble-voip/mumble.git you have to edit the source files as shown above.on the raspberry 2 I compiled with the following commands qmake -recursive main.pro CONFIG+="qt4-legacy-compat no-g15 no-server" make If you have any further questions don't hesitate to contact me.The solution is great. We have many users on the repeater with mumble. Our next step is to connect two or more repeater. Grandp-GHere from the beginning. Link to comment Share on other sites More sharing options...
hamie Posted April 18, 2016 Share Posted April 18, 2016 Anyone compile this on the RPI3 yet? Link to comment Share on other sites More sharing options...
hamie Posted March 13, 2017 Share Posted March 13, 2017 Can you past your MainWindow.cpp on pastebin?I'm having trouble with where to put QTimer *gpioPollingTimer = new QTimer(this); connect(gpioPollingTimer, SIGNAL(timeout()), this, SLOT(onGpioPoll())); gpioPollingTimer->start(100); // 100ms polling Intervalldid you have to edit the UI and add a timer in? Link to comment Share on other sites More sharing options...
sm0ohc Posted March 28, 2017 Share Posted March 28, 2017 Is there a possibility to also have a copy of that image for a PI2 to our clubs repeater ?73:s de K. Link to comment Share on other sites More sharing options...
Intrax Posted May 28, 2017 Share Posted May 28, 2017 Good day,I found this topic while searching for information for my project.'stephensworld' finished the issue where i was looking for.I turned my Raspberry into an programming environment as described here.I can't get the job done because i think I'm missing some information about editing the source files.When i start compiling, there are errors. Perhaps it has to to with versions because this topic is 1.5 years old, or I'm doing something wrong with the editing part of the source files. I'm not a programmer so i just follow the steps written by 'stephensworld'.I did not succeed. Can someone rewrite the steps so it will match with the current software versions?Otherwise is there an option to get a compiled version of Mumble client for Raspberry (with PTT signaling on GPIO interface). Best regards,Alex Link to comment Share on other sites More sharing options...
Intrax Posted May 30, 2017 Share Posted May 30, 2017 Hi,Is it possible someone with knowledge rewrites this handout?It is not clear where to made the changes exactly (right place in source). When i try to compile i get much errors. I'm not a programmer so i can just follow the steps written by 'Stephensworld'.This post is 1,5 years old so i think it is not usable for current versions of mumble. Is it?I hope someone can help to make a Mumble PTT radio (GPIO port signal) for Rasbian (Pi2 and 3) Perhaps there is a compiled version available somewhere. One i can install on Raspbery Pi2/3.Best regards,Alex Link to comment Share on other sites More sharing options...
hamie Posted June 4, 2017 Share Posted June 4, 2017 Mine is a bit different on the the functions but here is some code blocks you can find to get it workingMainWindow.cppvoid MainWindow::setupGui() { updateWindowTitle(); setCentralWidget(qtvUsers); setAcceptDrops(true); QTimer *gpioPollingTimer = new QTimer(this); connect(gpioPollingTimer, SIGNAL(timeout()), this, SLOT(onGpioPoll())); gpioPollingTimer->start(100); // 100ms polling Intervallvoid MainWindow::destroyUserInformation() { UserInformation *ui = static_cast<UserInformation *>(sender()); QMap<unsigned int, UserInformation *>::iterator i; for (i=qmUserInformations.begin(); i != qmUserInformations.end(); ++i) { if (i.value() == ui) { qmUserInformations.erase(i); return; } } } void MainWindow::onGpioPoll() { static bool pttGpioPrevState = false; static bool pttGpioState = false; QList<ClientUser *> talkingUsers = ClientUser::getTalking(); // For someone else to be talking we have to be connected to the //server and there must be at least one person talking that isn't ourselves static bool pttPrev = false; const bool someoneElseTalking = g.sh && !(talkingUsers.empty() || (talkingUsers.size() == 1 && g.uiSession == talkingUsers.first()->uiSession)); if (someoneElseTalking) { if(!pttPrev){ system("echo 1 > /tty/pttctrl"); pttPrev=true; } } if(!someoneElseTalking){ if (pttPrev){ system("echo 0 > /tty/pttctrl"); pttPrev=false; } } } Link to comment Share on other sites More sharing options...
Intrax Posted June 4, 2017 Share Posted June 4, 2017 Thank you very much Hamie,Can you tell me something about 'main.cpp'?Where to place these parts exactly?#include .....wiringPiSetupSys();pinMode(10,OUTPUT);pinMode(25,INPUT);In the source, #include statements are between " " instead of < > Link to comment Share on other sites More sharing options...
Intrax Posted June 5, 2017 Share Posted June 5, 2017 I want to run the Mumble client (with PTT signaling) on a Raspberry Pi3 (or a Pi2, if a Pi3 is not supported yet)@Hamie, do you have it working on a Pi3?Do you have a working image i can get?I'm afraid i will not succeed because all the information i can find to do the job is outdated.Mumble has renewed a few times and all the (PTT) modifications i can find are more then 2 years old.I'm not a programmer, just a technician so i hope someone can help me to accomplish.At this moment i'm stranded with errors while compiling. I don't know where to place the code of my previous message. I get errors like this: main.cpp:46:9: error: expected constructor, destructor, or type conversion before ‘(’ token pinMode (10,OUTPUT); Link to comment Share on other sites More sharing options...
stephensworld Posted July 2, 2017 Author Share Posted July 2, 2017 Hi,I think it also works with the latest source from github.I had to install: apt-get install build-essential pkg-config qt5-default libqt5svg5-dev \ libboost-dev libasound2-dev libssl-dev \ libspeechd-dev libzeroc-ice-dev libpulse-dev \ libcap-dev libprotobuf-dev protobuf-compiler \ libogg-dev libavahi-compat-libdnssd-dev libsndfile1-dev \ libg15daemon-client-dev libxi-dev qttools5-dev-tools Compiling with qt5 instead if qt4 qmake -recursive main.pro CONFIG+="no-g15 no-server" LIBS+="-lwiringPi" make Here you can find the edited source code with ptt including a binary in mumble/releaseshttp://ul.to/mk59svl0Here you can find only a binary with ptt modhttp://ul.to/11ybvumzIf you use the binary you should install mumble with apt-get install mumble.So you should have all dependencies.Stephan Link to comment Share on other sites More sharing options...
Intrax Posted July 5, 2017 Share Posted July 5, 2017 Thank you very much Stephan for your support.I hope i can get it to work soon. :) Link to comment Share on other sites More sharing options...
stephensworld Posted July 5, 2017 Author Share Posted July 5, 2017 If you have any problems. Please contact me.Skype dl4ste Link to comment Share on other sites More sharing options...
nando.dominios Posted March 24, 2018 Share Posted March 24, 2018 If you have any problems. Please contact me.Skype dl4steHello Stephensworld, i send a mp with more details to your skype acount, i already put your hack in a clone github, but i cant compile it for rpi3b and the actual version from this topic have problems with raspbian strech recently updated (lib modules).This is the github, can any compile it? Already have the hacks for io pins.https://github.com/hostfer/mumbleptt Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now