Reading MDF4-Files containing Ethernet Signals - ethernet

I am trying to read logger measurement files whicha are in the .mf4-format.
For this I am using asammdf as following:
self.mdf = MDF("file.MF4", version="4.10")
If the .mf4 file only contains CAN-Bus or Flexray signals, it works just fine.
Now I am trying to read .mf4-files that also contains Ethernet signals. The following error occurs:
asammdf - ERROR - Expected "##CA" block #0x54f68 but found "b'##CN'" NoneType: None asammdf.blocks.utils.MdfException: Expected "##CA" block #0x54f68 but found "b'##CN'"
Is it possible to read MDF4 files containing Ethernet signals?

Related

How to fix "error in module SensorManager during network initialization" in Castalia

I've been trying to run valueReporting simulation using castalia. I've edited the ini file in ordre to add to a node 2 sensor devices ( weight and blood glucose). However i'm facing the following error running the simulation :
Error in module (SensorManager) SN.node[0].SensorManager (id=10) during network initialization: Model error:
[Sensor Device Manager]: The parameters of the sensor device manager are not initialized correctly in omnet.ini file..
Here's a sample of the omnetpp.ini file. omnetpp.ini
Does anybody have any idea why i'm having this error ? if so, how can i fix it ?
Thank you !
If you searched for the error message The parameters of the sensor device manager are not initialized correctly in omnet.ini file in the code you would find it in SensorManager.cc.
You could then figure out that this error is triggered when any of 9 parameters do not match the number of sensor devices you have on the node. These are the 9 parameters:
SN.node[0].SensorManager.sensorTypes
SN.node[0].SensorManager.corrPhyProcess
SN.node[0].SensorManager.pwrConsumptionPerDevice
SN.node[0].SensorManager.maxSampleRates
SN.node[0].SensorManager.devicesBias
SN.node[0].SensorManager.devicesNoise
SN.node[0].SensorManager.devicesSensitivity
SN.node[0].SensorManager.devicesResolution
SN.node[0].SensorManager.devicesSaturation
You only define the first two correctly in your ini file. All the rest have the default values, which include only one sensor type, you need to include two values for each. You can look at SensorManager.ned to see what are the default values that these parameters take. You can then simply copy these values, or change them according to your needs.
For example devicesNoise default value is "0.1", so for two sensing devices it can be "0.1 0.1"

Cannot connect to COM port in MATLAB

I am running a code for my FPGA to collect data from accelerometer and I am able to print that to Tera Term. And I followed this tutorial to have MATLAB plot the data in real time.
I have essentially used the same code except a few changes in variable names title.
It gives me the following error.
The mathwork website has a similar question posted but there is no solution.
Open failed: Cannot connect to the COM6 port. Possible reasons are
another application is connected to the port or the port does not
exist.
Error in Untitled (line 8) fopen(s);
TIA

I2C: Raspberry Pi (Master) read Arduino (Slave)

I would like to read a block of data from my Arduino Mega (and also from an Arduino Micro in another project) with my Raspberry Pi via I2C. The code has to be in Perl because it's sort of a plug-in for my Home-Automation-Server.
I'm using the Device::SMBus interface and the connection works, I'm able to write and read single Bytes. I can even use writeBlockData with register address 0x00. I randomly discovererd that this address works.
But when I want to readBlockData, no register-address seems to work.
Does anyone know the correct register-address, or is that not even the problem that causes errors?
Thanks in advance
First off, which register(s) are you wanting to read? Here's an example using my RPi::I2C software (it should be exceptionally similar with the distribution you're using), along with a sketch that has a bunch of pseudo-registers configured for reading/writing.
First, the Perl code. It reads two bytes (the output of an analogRead() of pin A0 which is set up as register 80), then bit-shifts the two bytes into a 16-bit integer to get the full 0-1023 value of the pin:
use warnings;
use strict;
use RPi::I2C;
my $arduino_addr = 0x04;
my $arduino = RPi::I2C->new($arduino_addr);
my #bytes = $arduino->read_block(2, 80);
my $a0_value = ($bytes[0] << 8) | $bytes[1];
print "$a0_value\n";
Here's a full-blown Arduino sketch you can review that sets up a half dozen or so pseudo-registers, and when each register is specified, the Arduino writes or reads the appropriate data. If no register is specified, it operates on 0x00 register.
The I2C on the Arduino always does an onReceive() call before it does the onRequest() (when using Wire), so I set up a global variable reg to hold the register value, which I populate in the onReceive() interrupt, which is then used in the onRequest() call to send you the data at the pseudo-register you've specified.
The sketch itself doesn't really do anything useful, I just presented it as an example. It's actually part of my automated unit test platform for my RPi::WiringPi distribution.

cannot send data from arduino to MATLAB using a COM port

I'm trying to follow this guide on sending data from an arduino to a MATLAB program. I have every piece of code exactly matching the code in the example. However, whenever I attempt to start up the MATLAB program, I get the error message:
Error using serial/fopen (line 72) Open failed: Port: COM3 is not
available. Available ports: COM1. Use INSTRFIND to determine if other
instrument objects are connected to the requested device.
Error in Untitled8 (line 2) fopen(arduino)
Can anyone help me figure out how to get this working?
EDIT: My arduino is printing to COM3, so if I want MATLAB to hear it, it also needs to be COM3.
If I understand correctly you are using the Arduino IDE/Monitor to communicate with your Arduino on COM3. You want to have Matlab connect to the Arduino.
Since RS-232 is a point to point methology, you can only have one program/device on each end unless you add a bunch of hijinks.
When you have the Arduino IDE/Monitor open it uses the com port and other programs are denied access.
I think you need to close the Arduino monitor program to release Com port 3 and then the Matlab program should be able to open the port.

V4l2 : difference between : Enque, Deque and Queue(ing) of the buffer?

I am a noob in v4l2 and tryign to find out the difference between the various ioctl calls made during the camera image capture. I am following this pdf from the linuxtv.org site
I wanted to know the difference between the following :
Query, Enque, Deque and Queue(ing) of the buffer. Is there a particular sequence in fetching the raw data from the camera? Does the sequence varies in case of streaming and capture mode?
Can any one plz explain.
Following state machine describes a V4L2-buffer's life-cycle:
The sequence is the same for both streaming as well as capture.
Its just that during capture one does the Q/DQ just once to obtain one buffer (i.e. a single "frame"). Streaming does this repeatedly.
Detailed info in this series of V4L2 articles...
Part 1: The Video4Linux2 API
Part 2: registration and open()
Part 3: Basic ioctl() handling
Part 4: Inputs and Outputs
Part 5a: Colors and formats
Part 5b: Format negotiation
Part 6a: Basic frame I/O
Part 6b: Streaming I/O
Part 7: Controls