Raspberry PICO not working with message port, named hardware
Re: Raspberry PICO not working with message port, named hardware
Thanks Corjan for looking into this.
Regards, Wendy
Regards, Wendy
Re: Raspberry PICO not working with message port, named hardware
Hi,
Fixed the Serial.write issue and also noticed that the SI_MESSAGE_PORT_DEVICE_RPI_PICO definition was missing.
When that is used, AM will show the correct icon/name.
Both are now improved, there is a new Arduino library available here:
https://siminnovations.com/wiki/index.php?title=Arduino
Also just uploaded the latest AM BETA 43, which has the Serial port fix.
Hope this fixed everything, please let me know if something is still not working like it should,
Corjan
Fixed the Serial.write issue and also noticed that the SI_MESSAGE_PORT_DEVICE_RPI_PICO definition was missing.
When that is used, AM will show the correct icon/name.
Both are now improved, there is a new Arduino library available here:
https://siminnovations.com/wiki/index.php?title=Arduino
Also just uploaded the latest AM BETA 43, which has the Serial port fix.
Hope this fixed everything, please let me know if something is still not working like it should,
Corjan
Re: Raspberry PICO not working with message port, named hardware
Downloading now, thank you very much Corjan,
Joe
Joe
Joe. CISSP, MSc.
Re: Raspberry PICO not working with message port, named hardware
Small issue -
The problem with the pico initialising is solved. Connects fine.
If we call it an 'uno' at both ends, it works fine. (it is forcing hardware selection I notice) - so select arduino UNO and port A in the pulldown menus - all works
If I call it a pico - then it will show as a raspberry pi pico device with the logo ok, then I have to select from the pulldown so choose pico, channel A, and nothing.
no errors, just no communication.
As said, exactly the same program at both ends with the new MP lib and the AM Beta works fine providing the device is not named as a pico ?
Weird.
I am using one of my dev programs so I will write a very simple turn on led program to test. - a hello world type - will get back to you
Joe
The problem with the pico initialising is solved. Connects fine.
If we call it an 'uno' at both ends, it works fine. (it is forcing hardware selection I notice) - so select arduino UNO and port A in the pulldown menus - all works
If I call it a pico - then it will show as a raspberry pi pico device with the logo ok, then I have to select from the pulldown so choose pico, channel A, and nothing.
no errors, just no communication.
As said, exactly the same program at both ends with the new MP lib and the AM Beta works fine providing the device is not named as a pico ?
Weird.
I am using one of my dev programs so I will write a very simple turn on led program to test. - a hello world type - will get back to you
Joe
Joe. CISSP, MSc.
Re: Raspberry PICO not working with message port, named hardware
example to test - both ends - using new MP lib and also new AM beta.
message_id 100 will turn on the on board pico built in led
and
message_id 101 will turn on the off board pico built in led
Arduino sketch PICO
and the AM lua
when using it as a named 'uno' it works fine, as a pico it doesnt. (that is setting it in Arduino as UNO A and selecting UNO A from pull down options in AM works. As pico in Arduino and selecting PICO A from pull down options in AM it does not communicate.
Hope that helps ?
Joe
message_id 100 will turn on the on board pico built in led
and
message_id 101 will turn on the off board pico built in led
Arduino sketch PICO
Code: Select all
#include <si_message_port.hpp>
SiMessagePort* messagePort; // initialise our messagport object - here we chose the name 'messagePort'
void setup() { // setup: run once
messagePort = new SiMessagePort(SI_MESSAGE_PORT_DEVICE_ARDUINO_UNO, SI_MESSAGE_PORT_CHANNEL_A, new_message_callback);
//messagePort = new SiMessagePort(SI_MESSAGE_PORT_DEVICE_RPI_PICO, SI_MESSAGE_PORT_CHANNEL_A, new_message_callback);
pinMode(LED_BUILTIN,OUTPUT);
} // setup end
void loop() { // main program loop
messagePort->Tick(); // make sure to call frequently
} // loop end
static void new_message_callback(uint16_t message_id, struct SiMessagePortPayload* payload) {
// Do something with a message from Air Manager or Air Player
if (message_id == 100){
digitalWrite(LED_BUILTIN,HIGH);
}
if (message_id == 101){
digitalWrite(LED_BUILTIN,LOW);
}
}
Code: Select all
pico_test_led = hw_message_port_add("PICO_1", new_message_received) -- add our hardware device
function new_message_received(pico_led_test, payload)
--
end
hw_message_port_send(pico_test_led,100) -- pico built in led on
--hw_message_port_send(pico_test_led,101) -- pico built in led off
Hope that helps ?
Joe
Joe. CISSP, MSc.
Re: Raspberry PICO not working with message port, named hardware
Just for an experiment - do you have a complete list of the hardware IDs for the devices for messageport in AM ? - I have never seen them published.
Thanks
Joe
EDIT _ ignore the above I can use the prefixes from the HARDWARE ID master list. doh...
Thanks
Joe
EDIT _ ignore the above I can use the prefixes from the HARDWARE ID master list. doh...
Joe. CISSP, MSc.
Re: Raspberry PICO not working with message port, named hardware
Just tested with the new MP library and the AM Beta .
Same result as Joe I think...
-if you call it PICO, it is recognized automatically but no communication between PICO and the LUA script via messageport.
-if you cal it Arduino NANO for example, you see Arduino NANO in Air Manager and after selecting the device "Arduino Nano" and "Channel" it communicates.
Should be nice if we can call the device anything we want ?? Don't know if it is supposed to behave like that...
Regards, Wendy
Same result as Joe I think...
-if you call it PICO, it is recognized automatically but no communication between PICO and the LUA script via messageport.
-if you cal it Arduino NANO for example, you see Arduino NANO in Air Manager and after selecting the device "Arduino Nano" and "Channel" it communicates.
Should be nice if we can call the device anything we want ?? Don't know if it is supposed to behave like that...
Regards, Wendy
Re: Raspberry PICO not working with message port, named hardware
Hi,
Ah yes, I forgot to add something in the communication layer.
Is fixed now and will be part of next BETA release, which should be online now.
Corjan
Ah yes, I forgot to add something in the communication layer.
Is fixed now and will be part of next BETA release, which should be online now.
Corjan
Re: Raspberry PICO not working with message port, named hardware
@Corjan
All working superbly
Also the
works exactly as it should also.
Thank you for the super work as always.
I am going to duck under the table and ask for a feature request but I will post it in another thread after hiding and taking out insurance.
Joe
All working superbly
Also the
Code: Select all
if hw_connected("RPI_PICO_A") then
print("We have the right hardware hooked up !")
end
Thank you for the super work as always.
I am going to duck under the table and ask for a feature request but I will post it in another thread after hiding and taking out insurance.
Joe
Joe. CISSP, MSc.
Re: Raspberry PICO not working with message port, named hardware
@Corjan
Everything works fine now.
Thank you for a fast and perfect and great service.
@joe
Thanks for your help
Regards, Wendy
Everything works fine now.
Thank you for a fast and perfect and great service.
@joe
Thanks for your help
Regards, Wendy