LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 04-01-2024, 10:09 AM   #1
Nagesh_accord
LQ Newbie
 
Registered: Nov 2023
Posts: 17

Rep: Reputation: 0
To automatically take data of all interfaces like ADC, Audio, Enternet, Camera etc save to file and later replay them


Hi All,

I want to develop an application( may be a automated script which executes by default on boot up ) which takes backup of all the running live data( logs data in to files) on the various interfaces( like ethernet, ADA, Audio, camera, wifi, etc..... ) on my single-board-computer which is running on embeddedlinux ( may be Debian, ubunutu etc). - THis is first step of my project.

Later I should be able to replay all this data later for offline analysis.( that is later step)

Also this application will be further extended as TrueNAS application where I should be able to transfer this data to other units over the network and similarly able to receive the data from other units over the network. ( this is much more later step).

Please provide some guidance with some documentation / working sample python programs/script/etc first step for how to take live back of all the interfaces on my SBC
 
Old 04-01-2024, 11:18 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Nagesh_accord View Post
Hi All,
I want to develop an application( may be a automated script which executes by default on boot up ) which takes backup of all the running live data( logs data in to files) on the various interfaces( like ethernet, ADA, Audio, camera, wifi, etc..... ) on my single-board-computer which is running on embeddedlinux ( may be Debian, ubunutu etc). - THis is first step of my project. Later I should be able to replay all this data later for offline analysis.( that is later step)

Also this application will be further extended as TrueNAS application where I should be able to transfer this data to other units over the network and similarly able to receive the data from other units over the network. ( this is much more later step). Please provide some guidance with some documentation / working sample python programs/script/etc first step for how to take live back of all the interfaces on my SBC
So this is a project you want to accomplish, and you'd like us to research everything for you and give you documentation and programs/scripts??? What is the part of 'your' project that you're going to be doing??? You don't even tell us what brand/model computer you're going to use, what version/distro of Linux, what kind of data you want to save, how you want to save it, from what devices, etc. Should we guess as to all of this???

If you ask a clear question and provide details, we can try to help. And you are going to have to show your own efforts as well.
 
Old 04-01-2024, 01:14 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
As posted it is impossible to provide any help without knowing anything about your embedded system or other hardware that connects to the SBC.

Recording analog signals depends on the hardware and how the operating system "interfaces" with the hardware. Does playback imply you want to recreate the original signal or just digital data? That might determine how the data is recorded. Do you want the playback of all signals to be synced together?
 
Old 04-01-2024, 03:15 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by michaelk View Post
As posted it is impossible to provide any help without knowing anything about your embedded system or other hardware that connects to the SBC.

Recording analog signals depends on the hardware and how the operating system "interfaces" with the hardware. Does playback imply you want to recreate the original signal or just digital data? That might determine how the data is recorded. Do you want the playback of all signals to be synced together?
Based on the OP's original post, they want network traffic, audio, video, wifi, and "etc" to ALL be captured. They don't say what formats, how it's stored (wireshark data to 'play back' later?) or where/how.

Honestly, this sounds like they're trying to build some sort of network logging/hacking tool, to surreptitiously record things for 'offline analysis' (after the device is retrieved?).
 
Old 04-01-2024, 11:46 PM   #5
Nagesh_accord
LQ Newbie
 
Registered: Nov 2023
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
So this is a project you want to accomplish, and you'd like us to research everything for you and give you documentation and programs/scripts???
Sorry for the confusion, that my post created. My intention was not that. As this is the new project I am starting, I wanted some guidelines and opinions to how to go about not exactly code/script/etc.

Quote:
Originally Posted by TB0ne View Post
What is the part of 'your' project that you're going to be doing???
My part of the project is to develop an application called data recorder( which should record all the interfaces like ethernet, ADC, Audio, video, wifi, 5G, etc data locally within the embedded hardware SBC) which should work in sync with TrueNAS/freeNAS for the network functionalities also not only local hardware.


Quote:
Originally Posted by TB0ne View Post
You don't even tell us what brand/model computer you're going to use, what version/distro of Linux,
This we are yet to decide. Probably Intel based Xeon SBC. We are doing intial round of study to finalize on the hardware.
Any recommendations from you is welcome. What about Nvidia's Jetson modules SOMs? can we use them for such type of application any idea.
I had recently worked on NVidia Jetson agx xavier SOM - Jetpack version 5.1.2 , Linux for tegra version(L4T) 35.4.1, its ubuntu flavour(20.02 or something) only customizing various interfaces like audio, CAN, GPIO, Camera, HDMI etc where I had modified device tree files , installed some third party drivers etc to make the system work.

Quote:
Originally Posted by TB0ne View Post
what kind of data you want to save, how you want to save it, from what devices, etc. Should we guess as to all of this???
The requirement told was to collect almost all interface data so I listed what ever possible.
I will try list out assuming these will be there as of now:

GPIO,
CAN,
ETHERNET,
USB,
HDMI,
AUDIO
CAMERA,
ADC,
5G Cellular
GPS,
Bluetooth


Quote:
Originally Posted by TB0ne View Post

If you ask a clear question and provide details, we can try to help.
Definitely, I would be asking specific questions in coming days as we proceed with this project. I have just started the project background study based on the requirement I was told. I would be looking forward with all your help. Thanks in advance for all your guidance.

Quote:
Originally Posted by TB0ne View Post
And you are going to have to show your own efforts as well.
Of course. I should efforts to complete this project.
 
Old 04-02-2024, 12:47 AM   #6
Nagesh_accord
LQ Newbie
 
Registered: Nov 2023
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
As posted it is impossible to provide any help without knowing anything about your embedded system or other hardware that connects to the SBC.
Definitely. I will provide more details in coming days when the project comes live. Currently, I am doing kick off/back ground study of the project to understand the feasibilities, pros/cons of this project. Any over heads or technical hurdles that we may come across.

Quote:
Originally Posted by michaelk View Post
Recording analog signals depends on the hardware and how the operating system "interfaces" with the hardware.
Ok. We will see this once the hardware is finalized. However to start off with lets take an example, we have I2S line coming from the SOM for Audio purpose. How do we record this data?
I know we use "aplay" to play a audio file and "arecord" command to record voice. How to embedded these commands to in a common script which as other commands/instructions to record data from other interfaces like CAN, ethernet, wifi etc. Just want a head up about these. Any samples regarding the same would be helpful to study and start off with.

Quote:
Originally Posted by michaelk View Post
Does playback imply you want to recreate the original signal or just digital data? That might determine how the data is recorded.
As far my current understanding of the requirement told to me, it is digital data we need to save in encrypted format in a file and later decrypt it in offline mode before playing it.


Quote:
Originally Posted by michaelk View Post
Do you want the playback of all signals to be synced together?
Yes, this was told to me during requirement discussion. Any thoughts/information or links explaining how to do this?

Also I want to know, if we can write any application using C/Python/Shell scripts on the TrueNAS so save the local hardware interfaces data in to file?
 
Old 04-02-2024, 01:58 AM   #7
Nagesh_accord
LQ Newbie
 
Registered: Nov 2023
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Based on the OP's original post, they want network traffic, audio, video, wifi, and "etc" to ALL be captured. They don't say what formats, how it's stored (wireshark data to 'play back' later?) or where/how.
Still the requirements are not freezed. We are doing initial study about the feasibility and the methodology to implement this.

for example audio data will be in .wav file format
Camera images will be in raw bayer format or for some it will being compressed format like jpeg, png etc
ADC data can be saved in the .txt file
Ethernet port data can be saved in some file format

Please let me know, if my understanding correct.

Quote:
Originally Posted by TB0ne View Post
Honestly, this sounds like they're trying to build some sort of network logging/hacking tool, to surreptitiously record things for 'offline analysis' (after the device is retrieved?).
It a type of data recorder application to record the interface data and store it in encrypted format and later decrypt it during relay in offline mode.
Nothing surreptitious here. Its requirement for our project.

Could you please tell me if we can develop interfaces data recording application this on a trueNAS Operating system? or we should do in on some embedded linux operating system residing on some hardware.

or

trueNAS and this data recorder application which we are planning to implement are two different things and independent to each other?

Thanks.

Last edited by Nagesh_accord; 04-02-2024 at 03:21 AM.
 
Old 04-02-2024, 08:19 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Nagesh_accord View Post
Still the requirements are not freezed. We are doing initial study about the feasibility and the methodology to implement this.

for example audio data will be in .wav file format Camera images will be in raw bayer format or for some it will being compressed format like jpeg, png etc ADC data can be saved in the .txt file Ethernet port data can be saved in some file format Please let me know, if my understanding correct.
Who can tell??? You still haven't told us ANY details about what you're actually trying to accomplish. And you don't even know how you want to store this....saying 'wav','png', etc. And "some file format", tells us nothing. How is it going to be 'shared' later?? Identified?? Is there some point to capturing ethernet data for the device you already KNOW?
Quote:
It a type of data recorder application to record the interface data and store it in encrypted format and later decrypt it during relay in offline mode. Nothing surreptitious here. Its requirement for our project. Could you please tell me if we can develop interfaces data recording application this on a trueNAS Operating system? or we should do in on some embedded linux operating system residing on some hardware.
Since it's a 'requirement', then you obviously have a LIST of these, right??? And you now want to encrypt/decrypt data during relay in offline mode???? Yeah...doesn't sound like you want to plant this somewhere and look at data later when you can retrieve it at all.

Want to develop an interface to a trueNAS?? Yes, you can...this is the part of your project that *YOU* are going to do, right???
Quote:
trueNAS and this data recorder application which we are planning to implement are two different things and independent to each other?Thanks.
Again, you're asking us to do research for you, give you scripts/programs, and as of yet haven't shown ANY of your own work. And you say that the project isn't 'freezed', then go on to say you have project requirements...which is it??

Again; provide actual details and show us your efforts.
 
Old 04-02-2024, 08:37 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Except for the camera if the primary function is to record interface data then expecting all possible types of interfaces is not practical. CAN or Ethernet might indicate it is part of a bigger system or project but omeone has to define the exact requirements.

How to record ADC data depends on the actual input voltage, how fast it changes, the range, resolution etc. GPIO can be input or output, where is the signals coming from and how fast does it change. GPS data can be serial port, TTL etc. USB as serial data, ASCII or binary.

I2S is a serial data protocol. Do you want to record raw data i.e. the actual signals and clock or just the PWM data from the audio device?

linux is close but not a real time operating, recording latency might be important. Depending on what you actually record using a NAS as a storage media may not meet your bandwidth requirements.
 
Old 04-08-2024, 05:47 AM   #10
Nagesh_accord
LQ Newbie
 
Registered: Nov 2023
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
Except for the camera if the primary function is to record interface data then expecting all possible types of interfaces is not practical. CAN or Ethernet might indicate it is part of a bigger system or project but omeone has to define the exact requirements.

Thanks for the updates.
Sure. I will discus with the concerned people and get the actual requirements in detail.

Quote:
Originally Posted by michaelk View Post
How to record ADC data depends on the actual input voltage, how fast it changes, the range, resolution etc. GPIO can be input or output, where is the signals coming from and how fast does it change. GPS data can be serial port, TTL etc. USB as serial data, ASCII or binary.

I2S is a serial data protocol. Do you want to record raw data i.e. the actual signals and clock or just the PWM data from the audio device?
definitely we need all these details once the hardware is finalized and coding/scripting is started. Before that they wanted us to do a background study to see, if this is practically possible and feasible to implement on a NAS system.

Quote:
Originally Posted by michaelk View Post
linux is close but not a real time operating, recording latency might be important. Depending on what you actually record using a NAS as a storage media may not meet your bandwidth requirements.
Yes. This is a crucial point and which needs discussion and some clarification.

However, if the data recorded is local on the given unit, then latency and bandwidth might not be a issue because we are not capturing data over the network with data written on the NAS storage device.

Just incase, just wanted to ask if Lynx would be a better real time operating system for such an application. let us know your thought on this.
 
Old 04-08-2024, 06:00 AM   #11
Nagesh_accord
LQ Newbie
 
Registered: Nov 2023
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Who can tell??? You still haven't told us ANY details about what you're actually trying to accomplish. And you don't even know how you want to store this....saying 'wav','png', etc. And "some file format", tells us nothing. How is it going to be 'shared' later?? Identified?? Is there some point to capturing ethernet data for the device you already KNOW?
Sorry. All this will be clarified once the hardware and requirements are finalized. Currently, we are doing background and feasibility study, to confirm that we can implement this on NAS supported Linux OS - FreeBSD comfortably( or do we need any real time operating system like Lynx ) before going ahead and finalizing the right hardware for this

Quote:
Originally Posted by TB0ne View Post
Since it's a 'requirement', then you obviously have a LIST of these, right??? And you now want to encrypt/decrypt data during relay in offline mode???? Yeah...doesn't sound like you want to plant this somewhere and look at data later when you can retrieve it at all.
doesn't sound or does sound? . This encryption and decryption was part of our requirement during our discussion, however this part will be implemented at the last stage of the project.

Quote:
Originally Posted by TB0ne View Post
Want to develop an interface to a trueNAS?? Yes, you can...this is the part of your project that *YOU* are going to do, right???
Thanks for confirming that we can implement this data recorder feature on a NAS based OS( free BSD)

Quote:
Originally Posted by TB0ne View Post
Again, you're asking us to do research for you, give you scripts/programs, and as of yet haven't shown ANY of your own work. And you say that the project isn't 'freezed', then go on to say you have project requirements...which is it??
Sorry for the confusion. Basically the idea is to perform background and technical feasibility study of these requirements can be implemented smoothly without any technical hindrance later on after the hardware is finalized and we have started the implementation.


Quote:
Originally Posted by TB0ne View Post
Again; provide actual details and show us your efforts.
Definitely, I will show once we start with implementation of the project after the hardware setup is ready. But definitely it may take quite an amount of time , till then technical feasibility study would be done.
 
Old 04-08-2024, 06:36 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
Without knowing anything about the project it isn't possible to say whether or not you need a RTOS or say whether or not it could run via TrueNAS. It seems like the overhead of all the builtin services of the NAS would not be good.
 
Old 04-08-2024, 07:48 AM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Nagesh_accord View Post
Sorry. All this will be clarified once the hardware and requirements are finalized. Currently, we are doing background and feasibility study, to confirm that we can implement this on NAS supported Linux OS - FreeBSD comfortably( or do we need any real time operating system like Lynx ) before going ahead and finalizing the right hardware for this
If you have zero details to provide, there will be zero answers anyone can give you.
Quote:
doesn't sound or does sound? . This encryption and decryption was part of our requirement during our discussion, however this part will be implemented at the last stage of the project.
Definitely DOES sound like it, doesn't it??
Quote:
Thanks for confirming that we can implement this data recorder feature on a NAS based OS( free BSD)
I confirmed nothing; I told you that YOU had to implement things you wanted. Since (AGAIN) you provide no details, we can't confirm anything.
Quote:
Sorry for the confusion. Basically the idea is to perform background and technical feasibility study of these requirements can be implemented smoothly without any technical hindrance later on after the hardware is finalized and we have started the implementation.
AGAIN: we have no idea, since you've given no details. It may be feasible...may not be.
Quote:
Definitely, I will show once we start with implementation of the project after the hardware setup is ready. But definitely it may take quite an amount of time , till then technical feasibility study would be done.
Then you should actually go do it, and provide the details. For someone who can't tell us anything, it seems like you've got a huge list of 'requirements' for your project...hard to know why, when you have such a list, you have trouble saying definitively what your actual requirements ARE, past vague "I want to store things".
 
Old 04-11-2024, 12:43 AM   #14
Nagesh_accord
LQ Newbie
 
Registered: Nov 2023
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
Without knowing anything about the project it isn't possible to say whether or not you need a RTOS or say whether or not it could run via TrueNAS. It seems like the overhead of all the builtin services of the NAS would not be good.
Thanks for the updates. That was good information about NAS support for my data recording feature which might be a burden.overhead, will keep this in mind.
 
Old 04-11-2024, 12:55 PM   #15
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,226

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
The ethernet capture would be done with tcpdump, would it not?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ifup: couldn't read interfaces file "/etc/network/interfaces" debian lenny lorimer73 Linux - Networking 1 08-24-2010 03:47 PM
LXer: Save a Web page for later with Read It Later extension LXer Syndicated Linux News 0 09-29-2008 11:50 AM
enternet 300 for linux paul62 Linux - Networking 1 07-02-2004 11:09 AM
Problem in Enternet Card detection prashantbss Linux - Networking 0 03-13-2004 04:31 AM
Enternet 300 h1cks Linux - Networking 1 02-10-2002 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 04:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration