no, you need to use it from within the class and use the fd
variable. It doesn't seem to work for me, it always gives me bytes_avail == 0
, even if the ioctl succeeds.
Get number of characters in Serial Buffer?
Ah, ok. Thanks!
Wow, fantastic! Thanks so much for adding this!
I downloaded Serial.h + Serial.cpp and put in my project folder, but what is the correct way to update (or add new) library files?
Updating the files in /root/Bela/libraries/Serial or update the entirety of the bela core code to the branch containing the relevant version of the files ( dev branch in this case)
https://learn.bela.io/using-bela/bela-techniques/updating-bela/#updating-to-an-experimental-release
Thanks! I can browse to the /root/Bela/libraries
folder via ssh and see the files there. But how do I transfer files from my PC? I tried using scp serial.h root@bela.local:root/Bela/libraries/Serial
but it said the host was not known.
m3rten host was not known.
how do you ssh onto the board?
I use the Windows command prompt and type ssh root@bela.local
. Then I can see the files on Bela. But my understanding of the Linux world is very limited unfortunately.
Then this scp Serial.h root@bela.local:root/Bela/libraries/Serial
should not return a host not known error message, as you are using exactly the same host as ssh root@bela.local
.
- Edited
I'm clearly doing this wrong. I've placed a file here C:\Users\m\test.txt
but I'm not sure what directory I should be in when i issue the copy command. (I'm sorry to bother you with this, it's really not a Bela issue, rather me not understanding Linux)
C:\Users\m>scp test.txt root@bela.local:root/Bela/libraries/Serial
scp: root/Bela/libraries/Serial: No such file or directory
C:\Users\m>ssh root@bela.local
[...]
____ _____ _ _
| __ )| ____| | / \
| _ \| _| | | / _ \
| |_) | |___| |___ / ___ \
|____/|_____|_____/_/ \_\
The platform for ultra-low latency audio and sensor processing
[...]
Bela image, v0.3.8h, 5 January 2023
[...]
root@bela:~# scp test.txt root@bela.local:root/Bela/libraries/Serial
Warning: Permanently added the ECDSA host key for IP address '192.168.6.2' to the list of known hosts.
test.txt: No such file or directory
root@bela:~#
- Edited
m3rten No such file or directory
that's very different from "host not known". The issue is the missing /
before root/
in the destination path: if the first character after :
is a forward slash, it is an absolute path, otherwise it is a relative path (relative to /root/
. In your case you are trying to copy to /root/root/Bela/libraries/Serial
, which doesn't exist. You can do ;scp text.txt root@bela.local:Bela/libraries/Serial
or scp text.txt root@bela.local:/root/Bela/libraries/Serial
Great, it works now! Thanks for the patience!