在 2023年9月11日星期一 CST 下午7:22:44,Bogdan Reshetnikov 写道: > Good day everyone! I hope you are doing well. > > I am an EE undergrad intern at an RF design company's software > department, currently tasked with controlling a HackRF One SDR with a > touchscreen display and a Raspberry Pi Zero (flashed with PiSDR because > it has gnuradio3.9) running Python 3.9. I am a total beginner in GNU > Radio, but I have intermediate knowledge of writing various interfaces > in Python. > > The RPI runs a threaded script that receives UART a command from the > display, parses it, and sends a {"parameter": value} PMT pair through > ZMQ PUB socket. > It also runs a GNU Radio flowchart script in parallel that receives the > packet through ZMQ SUB Message source and passes it onto a Message to > Variable block. > This setup works great for modifying a single variable that's specified > in the MesgToVar block, but it breaks down for multiple variables, since > the <name> from the message pair is ignored. > > My current idea is to write an Embedded Python Block that would act as a > "message multiplexer": it would parse the <name> part and issue a > message from an according output port. This would mean updating the EPB > code for every new variable, but that doesn't sound problematic. > > Does this sound like a nice approach? Are there any better alternatives > already present? Let me know what you think. Stay safe! > > Bogdan > > I have a similar project, modify multiple parameters with one block. But it's a different case: I need to change variable with python block, so the solution is simple to me: just write multiple message output port and use separate message to var block and it works fine. For your situation, writing a "message multiplexer" is by far the best idea I can think. BTW, my project address is https://github.com/Bob0111/HackRF-mutiple-freqeuncy-FM-transmitter if you have any interest, welcome to view that.
Bob