OpenWRT and Fluent Bit - Serial Input

538 views
Skip to first unread message

Bruno Godoi Eilliar

unread,
May 17, 2016, 7:50:26 AM5/17/16
to Fluent-Bit


Hi!

I'm working with fluent bit cross compile for a Dragino MS14 device, with a OpenWRT custon linux firmware.
I've successfully compiled fluent-bit for my target device and now my base OpenWRT image contains an "almost" working fluent-bit version.

Yeah, almost...because the Serial input plugin is not working properly, even though the compilation process finished without errors.

Here is what happens: the cpu and memory plugin work well, but when I try to use serial plugin (with a specific serial.conf file) I get the following message (image):

The serial.conf content is:


[SERIAL]
    # file
    # ====
    # Filename of serial port. e.g. /dev/ttyS0, /dev/ttyAMA0

    file    /dev/ttyATH0

    # Bitrate
    # ========
    # Specify the bitrate to communicate using the port.

    bitrate 115200



I checked the serial connection using picocom, and it's working fine....


I'd be glad if you have any clue on this...

Bruno G. Eilliar
bruno...@devtecnologia.com.br

Eduardo Silva

unread,
May 17, 2016, 9:14:46 AM5/17/16
to Bruno Godoi Eilliar, Fluent-Bit
Hi Bruno,

first of all thanks for confirm it's working well with OpenWRT :)

Note that v0.8 is under active development and the way configuration works has changed. Now Fluent Bit supports one main configuration file and each output "instance" defines it own keys/values. In order to setup 'serial' it should be done in the following way:

https://gist.github.com/edsiper/687f549ba520746752131b7010f5d9cc

For short: a [SERVICE] section must exists, then for every input/output plugin an [INPUT] and [OUTPUT] sections exists. Note that INPUTS have a 'tag' while OUTPUTS have a match, that's the new way to route records between plugins.

The documentation should be updated shortly, note again that this 0.8 is under development. Let me know how it goes!

cheers




--
You received this message because you are subscribed to the Google Groups "Fluent-Bit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluent-bit+...@googlegroups.com.
To post to this group, send email to fluen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fluent-bit/c3f26580-50ff-4d20-bf8b-0d543334eda6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Eduardo Silva
Open Source, Treasure Data
http://www.treasuredata.com/opensource

http://twitter.com/edsiper
  http://www.linkedin.com/in/edsiper

Bruno Godoi Eilliar

unread,
May 17, 2016, 10:49:49 AM5/17/16
to Fluent-Bit

Hi Eduardo.

Tks for your attention...

So, I did what you said and still gets the same error, but now the serial plugin seems to be loaded properly.
The strange thing is that if I use a wrong file name for my serial interface (the correct one is /dev/ttyATH0) it returns the same error ^^ '.

Finally, I'd like to congratulate you guys for your work.... I will continue to watch the project development. o/

Bruno G. Eilliar
bruno...@devtecnologia.com.br

Eduardo Silva

unread,
May 17, 2016, 11:26:20 AM5/17/16
to Bruno Godoi Eilliar, Fluent-Bit
I just did a review and tested and is working properly here. The error you are getting it's from an old version of Fluent Bit (meaning old = I did a lot of changes yesterday), so please update your local copy and give it a try again.

best


For more options, visit https://groups.google.com/d/optout.

Bruno Godoi Eilliar

unread,
May 17, 2016, 11:46:53 AM5/17/16
to Fluent-Bit

Yes, it's like you said.

Now it manages to open serial port and receive data from it. The strange thing is that it seems to slice the message:

Thank you for your support Eduardo!

Best Regards.
Bruno G. Eilliar
bruno...@devtecnologia.com

Eduardo Silva

unread,
May 17, 2016, 11:54:52 AM5/17/16
to Bruno Godoi Eilliar, Fluent-Bit
Would you please try the "min_bytes" option in the configuration ?, it will tells the plugin to wait until a certain number of bytes before to process the message.

Just curious, what kind of device are you using ? what your project does ?

regards,


For more options, visit https://groups.google.com/d/optout.

Bruno Godoi Eilliar

unread,
May 18, 2016, 10:51:49 AM5/18/16
to Fluent-Bit
It works well with adjustment on min_bytes.... but maybe (on the future) the messages coming through  the serial port may vary in length with time.

So, we are testing applications to gather data for a new IoT device that we plan to launch, based on Qualcomm Atheros AR9331.

Thanks Eduardo.

Bruno G. Eilliar
bruno...@devtecnologia.com.br

Eduardo Silva

unread,
May 19, 2016, 10:39:09 AM5/19/16
to Bruno Godoi Eilliar, Fluent-Bit
Hi Bruno,

I was thinking to implement a workaround where the min_bytes option is not a solution. If the configuration supports a
"separator" string to determinate where the message ends, would that work for your case ?, e.g:

[INPUT]
    Name       serial
    Tag           my_serial_data
    Separator  ;
    ...

comments ?



For more options, visit https://groups.google.com/d/optout.

Bruno Godoi Eilliar

unread,
May 19, 2016, 11:37:58 AM5/19/16
to Fluent-Bit
Hello Eduardo.

That'd be awesome!

Bruno Godoi Eilliar
bruno...@devtecnologia.com.br

Eduardo Silva

unread,
May 19, 2016, 3:23:22 PM5/19/16
to Bruno Godoi Eilliar, Fluent-Bit
I have pushed an experimental patch that adds the 'Separator' feature:

     https://github.com/fluent/fluent-bit/tree/serial-sep

please checkout that branch and do the proper tests for your use case. The commit details are here:

https://github.com/fluent/fluent-bit/commit/779727e396bfa4929bf9f7d08bee1f774556eaeb

best


For more options, visit https://groups.google.com/d/optout.

Eduardo Silva

unread,
May 22, 2016, 10:18:35 PM5/22/16
to Bruno Godoi Eilliar, Fluent-Bit
note: I merged the "Separator" feature/changes into GIT master. Please let me know how it goes.

Eduardo Silva

unread,
May 25, 2016, 6:27:17 PM5/25/16
to Bruno Godoi Eilliar, Fluent-Bit
Hi Bruno

wondering if you manage to test the latest changes, any feedback is appreciated,

regards,

Bruno Godoi Eilliar

unread,
May 30, 2016, 9:30:29 AM5/30/16
to Fluent-Bit
Hi Eduardo,

Sorry for the delay.
I'm stuck trying to make the AWS IoT SDK working here and that's why I haven't tested this feature until now.

I'll test it this week and send you a feedback message.

Thank you for your help.

Best Regards.

Bruno Godoi Eilliar
bruno...@devtecnologia.com.br

Bruno Godoi Eilliar

unread,
Jun 17, 2016, 1:12:24 PM6/17/16
to Fluent-Bit
Hi Eduardo.

Glad to see the 0.8.1 announcement!
Everything is working well here and will continue to follow the project!

Thanks!
Bruno G. Eilliar
bruno...@devtecnologia.com.br
Reply all
Reply to author
Forward
0 new messages