Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#11 Post by jph »

Have you also considered the Teensy 4.1 ? - that is a total animal. 600MHz ! :o :shock: Quicker than a Scotsman hiding his wallet. Seriously effing fast.
8 MB Flash and 1MB ram. Native ethernet.

A real beast. Horses for courses though. All depends on your cunning plan for your 'widget' :D ;)

https://www.pjrc.com/store/teensy41.html

the S3 is still the best all round me thinks. I want to use it with ethernet and a sub protocol daughterboard driver (I2C) (2 way) so the ESP S3 acts as the master comms. (as per SISMO) . Also to link SISMO boards to AM. For this we need a very simply messageport type UDP protocol from AM. Just a single block of bytes with some basic addressing and IDs. Single data type only. Far simpler than message port as is. That then opens the world as the ESP-S3 can do whatever it wants with the data as it will be fully programmable by the user with just a very basic sketch for AM MP using the existing ETH lib. :mrgreen:
Joe. CISSP, MSc.

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#12 Post by Ralph »

Ive used the ENC28J60 in the past with the Raspberry Pi Zero. Works fine, but the LAN8720 looks like a more decent solution. Glad to hear that it is supported.

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#13 Post by Ralph »

This topic confused me: https://esp32.com/viewtopic.php?t=24595
I'm not sure what to take from it. Is there RMII on the S3, or did they drop the RMII support.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#14 Post by jph »

Hmm. Interesting, that has me baffled. I will do some digging. I mean it definitely has Layer 2 (MAC) due to the wifi, but whether this is exposed to a Layer 1 PHY device ,,,,,,,,,, ???

It would seem very strange NOT to. Very interesting and well spotted.

I will get back to you.
Joe
Joe. CISSP, MSc.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#15 Post by jph »

You are absolutely right Ralph, they HAVE removed the RMII register access from the S2 and S3. Obviously the MAC Later 2 stuff is there but not exposed. Interesting.

I can only believe they have done it for the reasons that the combined Layer 2 and Layer 1 (MAC and PHYsical) SPI units (like the 5500 etc) are so bloody efficient and in consideration of the HUGE number of GPIO pins that the RMII link to the PHY needed.

The SPI can run at 80MHz with DMA on the S3, as can the 5500 with a theoretical 15 Mbit/s throughput. That is pretty impressive and it's all hardware based SPI as well so minimum overhead.

What are you using the WTH 01 units as Ralph ? - are you using them as a pure serial to ethernet unit as designed ? - or are you programming the ESP on board for other things ? As is the WTH 01 is probably a slightly slower speed as opposed to an SPI W5500 if used as a serial to ethernet unit. The speed increases up to about 10Mb if you use both serial ports/pins in duplex mode

Joe
Joe. CISSP, MSc.


User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#17 Post by Ralph »

Oh wait, didn't you already post this? :D I just recognize the Ali Express image I believe...

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#18 Post by jph »

I have not seen that one actually. Looks tasty, but not supported in the Arduino IDE and apart from AM LUA, that's all I use although I am looking seriously into STM CUBE. Also, not sure of the cost of that one ? also a bit low on flash and ram ?
Anyway, after MUCH research and headaches
I just ordered 2 of these - I 'had' to order 2 again for the free shipping over 50 euros (that's my excuse ;) )- the previous ESP32-S3 units came directly from the states via UPS 48 hr so I am sure these will as well. No messing there
https://eu.mouser.com/ProductDetail/511-NUCLEO-F746ZG
Freeking amazing. Again 144 pin, on board RMII 10/100 ethernet - direct - NOT SPI - it uses an updaed version of the 8720 (I think its' the 8740 ?? - with the 10/100 network. 1 MB Flash and 320K SRAM. Absolutely loaded. Even includes the ST Link programmer which can be used as a VCP Serial, as well as on board USB (and ethernet). Hell, it even accepts arduino shields :shock: but you can run it in it's native mode as well.
Messageport runs :lol: so thats a start, all the libs I am interested in all compile fine. All the 'core' for this (the coding) is from STM directly so its' rather amazing. You can have high level or full low level stuff. You have about 100 gpio available - yikes.

22 dollars !. :o :o :o that is less than half the price of a bloody mega - ridiculous. It's rapid as well at 216 Mhz.
It is a thing of utter beauty :mrgreen:

The end part is the ST link programmer and debug, you can 'snap' that off if you want and have a small footprint, but it will let messageport work with nasty serial until more 'marvellous' options are available. (cough... cough.. )

here's a lovely piccy that I might frame. When I saw the support in Arduino with the STMduino stuff I was blown away. The image needs framing it is so lovely haha. :D
NUCLEOF746ZG.jpg
Joe. CISSP, MSc.

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#19 Post by Corjan »

Hi,


The third argument in the callback is more like a convenience thing. It is not documented since it should not be needed.
Since you know what kind of payload you send with each ID, there is no need to do any type parsing.

You could maybe check if the payload is of type array and is of a certain length if you want to be certain.


Corjan

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Decoding 'len' field in LUA in AM new_message function HW_Messageport ?

#20 Post by jph »

Thanks for the info Corjan.
I always know the type of data by the id, but there ARE times where I find it useful to send a varying amount of data under the same ID. For example, in a binary read of 256 individual digital inputs, giving 8 x int32_t I don't have to send the full 256 bits over the serial port for a minor change.

I have also since discovered that I can use #payload in LUA for the array length (in simple arrays) so that is really useful. :D

It is looking perfectly possible to control a complete Zibo overhead or pedestal from a single Pi Pico, with ease. The beauty of messageport, the utterly amazing Pico and devices like the SX1509 and various other I/O solutions.
Joe. CISSP, MSc.

Post Reply