BT on SIM800 not working - bluetooth

I cannot get Bluetooth to work on SIM800. AT+GSV command gives following response: SIMCOM_Ltd.
SIMCOM_SIM800
Rev: 1308B02SIM800M64_BT.
Any AT command I type (eg AT_BTSTATUS=?) gives ERROR. What could be the problem?

From the SIM800 manual here[*], page4, it should be:
AT+BTSTATUS?
Not AT_BTSTATUS=?
You may want to have a look at:
https://en.wikibooks.org/wiki/Serial_Programming/Modems_and_AT_Commands#AT_Commands
...and of course read the manual for your module.
*:
http://mt-system.ru/sites/default/files/simcom_sim800_series_bluetooth_application_guide_v1.01.pdf

Bluetooth in SIM800 has to be enabled first in order to be available for use.
To power up the bluetooth radio, just enter:
AT+BTPOWER=1

Related

Read and test BIOS vendor from grub

Recently due to supply shortage, we have been tasked with replacing a COMe module in our product. It has become necessary to determine which module is inserted since the serial redirection for boot output is different and other reasons.
I can use the command lsefisystab from the grub shell to see BIOS information and I can see the differences between boards - one BIOS is Phoenix and the other BIOS is Megatrends.
For example:
grub> lsefisystab
Address: 0x79b54f18
Signature: 5453595320494249 revision: 00020028
Vendor: American Megatrends, Version=5000a
...
However I cannot test the differences of the commands because I believe these are print statements and not returned values.
For example:
grub> if regexp "\bMegatrends\b" lsefisystab; then echo Found; else echo Not Found; fi
Not Found
In this case, lsefisystab is recognized as a string and not a command. Even commands such as read_dword only print the result.
Is there a way to test a grub command 'string response' or is there another way to detect which BIOS is running so that in my grub.cfg, I can choose the correct options to boot?

How can one mute an application using pipewire from CLI

I would like to automute certain audio clients when I want, without human intervention (e.g. pulling up pavucontrol) when using Fedora/pulsewire. This worked before using pacmd, but that doesn't work under pipewire; and the replacement command, pw-cli, doesn't support set-sink-input-mute or set-source-output-mute.
pw-cli doesn't seem to support muting that I could see. pw-mon shows a relevant change when using pavucontrol (or easyeffects) to mute a stream, but that didn't help me figure out how to do it myself.
This is a bit late but i recently needed it too. Instead of pacmd you can use pactl set-sink-input-volume <sink-id> <volume>

Uinput gamepad events not working

How are you? I hope you can help me with something, I have a problem from Artix Linux, I want to connect my Wii Remote to use it as a Gamepad, it does not want to work because the uinput module does not want to interpret the events associated with Gamepad Inputs, it does not catch for example "BTN_A" or others, but if I put another as "KEY_A" if it recognizes it but acts as a keyboard input in that case. What solution do you propose?
Note that I use WMinput, and I have already installed cwiid, wminput, and even fixed the uinput module in the kernel.
I had the same problem. In my case the error was that I tried to pass the button as an unsigned char. I realized later that BTN_A is not defined as 131 but as 0x131, so it doesn't fit into the unsigned char and gets truncated. Hope this helps!

Euterpea Exception: No MIDI output device found

I am trying to get started using Haskell's Euterpea library. My first goal was to get it to play a given sound file (e.g. mp3 or wav), but first I ran into an issue following instructions to get it to just play a simple note sound in ghci.
Following the "Setting up MIDI" instructions at Euterpea's web page, I ran
import Euterpea
play $ c 4 qn
in ghci. The 'play' command resulted in the following error message:
Prelude Euterpea> play $ c 4 qn
*** Exception: No MIDI output device found
CallStack (from HasCallStack):
error, called at ./Euterpea/IO/MIDI/MidiIO.lhs:122:18 in Euterpea-2.0.2-Iz37iWlkpjn2emP4FnvOI1:Euterpea.IO.MIDI.MidiIO
I thought I needed to specify midi output to my machine (macOS Sierra) and found an application called 'Audio MIDI Setup', but it showed that a midi output (my internal speakers) was already specified.
Anyone know what this issue is or how to fix it?
Perhaps you solved this, but for posterity some ideas:
Sounds like you didn't install and run a MIDI synth (e.g. SimpleSynth) first. AFAICT, Audio MIDI Setup doesn't actually include a software synthesizer, it's more for advanced / hardware MIDI setup.
This should create the MIDI output devices that Euterpea couldn't find there. You may also need to play around with channels (e.g. use playDev n instead of play and work out a value for n from your device list... or even just try 1 through 8)
Either way there's some good Mac-focussed help on Donya's working with MIDI on Mac OS X page. Hope that helps.

Automate Bluetooth Pairing/Trusting in Bluez5

I've been working on making my RPi 2 function like a car bluetooth receiver and all is well, except I have no idea how I could automate the pairing of bluetooth devices in Bluez5. In the past I would've used the bluetooth agent and a simple script, but that seems to have gone out the window with the move from 4 -> 5. The nature of the setup means I have no kb/mouse on the RPi once its in the car, so it needs to be a fully automated setup where anyone can scan for the RPi, and if the probably hard-coded PIN is correct, the trusting of the device needs to be automatically done, no cli input.
I've searched all over the web but everyone seems to say that using bluetoothctl works for them, but in this particular setup where I'd like to be able to have friends pair their own phones, having to trust devices with the RPi out of the car isn't ideal.
I'm not sure why you say using a simple script is not possible with bluez5. I think you can do it. Below is one example how.
Download the bluez5 source and edit test/simple-agent. Comment out the lines of code as shown below:
def RequestAuthorization(self, device):
print("RequestAuthorization (%s)" % (device))
#auth = ask("Authorize? (yes/no): ")
#if (auth == "yes"):
return
#raise Rejected("Pairing rejected")
What that does it remove the prompt for authorisation and always accepts the pairing request.
Can now start the simple-agent with the NoInputNoOutput capability so that it uses simple pairing and will go through the above code path:
./simple-agent -c NoInputNoOutput
After that you should be able to pair with the RPi without any user prompt or PIN.
Note that this is just one example of what you can do. If say you wanted to have a hard coded PIN instead of simple pairing then edit the appropriate section of the same simple-agent code to do that. I'll leave that as an exercise for you.
I already had bluez-5.43 installed. This is how to automate the pairing process on a raspberry pi.
(1) First test a line like this out to make sure bluetooth agent works:
bluez-5.43/test/simple-agent -c NoInputNoOutput
(2) To automate pairing, put this code into a shell file (I named mine pairbot.sh):
if [ "$(id -un)" != "pi" ]; then
exec sudo -u pi $0 "$#"
fi
export XAUTHORITY=/home/pi/.Xauthority
export DISPLAY=:0
lxterminal --command="/bin/bash -c '/home/pi/bluez-5.43/test/simple-agent -c NoInputNoOutput &; read'"
(3) Go to crontab:
sudo cronetab -e
(4) At the bottom add:
#reboot sleep 20 && /home/pi/pairbot.sh > /home/pi/blelog.txt 2>&1
(5) Reboot and test if it works.
My recommendation for others facing the same issue would be to look into your bluez folder (or if you don't have one install the latest version of bluez) and search for the folder that says "test" for "simple agent" to locate the file path. From here, you should be able to construct the command line shown above (1). Hopefully it will work for you too.

Resources