Comments (2)
Cannot reproduce.
The above is unclear exactly how to repro, but I used the following.
On the meadow (F7FeatherV2)
var port = Device
.PlatformOS
.GetSerialPortName("com4")
?.CreateSerialPort(19200, 8, Parity.None, StopBits.One, 2048)
?? throw new System.Exception("com4 not found");
var buffer = new byte[4096];
port.Open();
while (true)
{
var read = port.Read(buffer, 0, buffer.Length);
if (read == 0)
{
Thread.Sleep(1000);
continue;
}
Resolver.Log.Info($"rx {read:N4} bytes");
Resolver.Log.Info($" {Encoding.ASCII.GetString(buffer, 0, read)}");
}
on a PC
var port = new SerialPort("COM5", 19200);
port.Open();
var message = "On the 24th of February, 1815, the look-out at Notre-Dame de la Garde signalled the three-master, the Pharaon from Smyrna, Trieste, and Naples";
var messages = message.Split(' ', StringSplitOptions.RemoveEmptyEntries);
while (true)
{
for (var i = 0; i < messages.Length; i++)
{
var data = Encoding.ASCII.GetBytes(messages[i]);
port.Write(data, 0, data.Length);
Thread.Sleep(2000);
}
}
And it worked as expected.
from meadow.core.
@ctacke, i tested your code it with my testfile and HTerm, it produces the same error, the problem is the length of the datastream. You tested it with a message ~150 byte, but that is not enough to reproduce this error.
I used this to produce the datastream and the testfile:
byte[] prefix = new byte[] { 0x01, 0x10, 0x02, 0x20, 0x04, 0x40, 0x08, 0x80 };
byte[] buffer = new byte[1032];
for(int i = 0; i < buffer.Length; i++)
{
buffer[i++] = 0xFF;
buffer[i] = 0x00;
}
for (int j = 0; j < prefix.Length; j++)
{
buffer[j] = prefix[j];
}
File.WriteAllBytes(@"D:\file.txt", buffer);
_serialPort.Write(buffer, 0, buffer.Length);
Here is my generated testfile for HTerm: file.txt
from meadow.core.
Related Issues (20)
- Add package descriptions in the csproj HOT 1
- Update App instantiation
- WifiAdapter.Scan should return `IList<Network>` and be `async` HOT 3
- SpiClockConfiguration takes a long for speed HOT 1
- Review V2 pinouts HOT 2
- Unitize IPwm HOT 2
- Unexpected InterruptGroupInUseException HOT 4
- GetPortAndPin is returning an interrupt group but value is labelled pin
- App settings: restart log message not reflecting application settings? HOT 2
- App settings: JSON/YAML settings not affecting app? HOT 4
- Empty app config file throws exception on app load HOT 4
- Test Issue HOT 1
- MQTT Connection to Broker fails
- Add SD Card support to Update Service
- Validate ProjLab v3 RS485 HOT 1
- Complete NotImplemented items in Meadow.Linux
- Complete NotImplemented items in Meadow.Windows
- Move file system bits over to PlatformOS
- Add Cell Scanner
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meadow.core.