Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cooja serial communication from test script to nodes #2699

Open
fleutot opened this issue Jan 7, 2022 · 0 comments
Open

Cooja serial communication from test script to nodes #2699

fleutot opened this issue Jan 7, 2022 · 0 comments

Comments

@fleutot
Copy link

fleutot commented Jan 7, 2022

I am trying to send data (or rather commands) from the Cooja test script, to the firmware in the simulated nodes.

Node type: ContikiMote

Here is the mote type definition:

    <motetype>
      org.contikios.cooja.contikimote.ContikiMoteType
      <identifier>mtype345</identifier>
      <description>root node</description>
      <source>[CONFIG_DIR]/code/root.c</source>
      <commands>make root.cooja TARGET=cooja</commands>
      <moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
      <moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
      <moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
      <moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiEEPROM</moteinterface>
      <moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
      <moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
      <symbols>false</symbols>
    </motetype>

I have implemented (copied) the serial-line.[ch] files into my project, they build fine. I call the init function, and I understand that I need to connect the actual input of characters into the serial-line module with a callback.

Here is what I am missing: what is this input interface? I've seen someone suggesting using uart0, but I cannot find uart0_set_input() for ContikiMotes. I cannot find how to setup baudrate for that interface either.

I've tried with Cooja platform's rs232 (copied a bunch of files such as rs232.[ch], simEnvChange.[ch]), with no success (tried all the defined speeds):

    rs232_init();
    rs232_set_speed(RS232_19200);
    rs232_set_input(serial_line_input_byte);
    serial_line_init();

How do I connect and setup a ContikiMote serial input interface to the serial-input module, in the node's code?

alexrayne pushed a commit to alexrayne/contiki that referenced this issue Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant