- 👋 Hi, I’m @hbjorgo
- 👀 I’m interested in .Net and embedded development and electronics
hbjorgo / atlib Goto Github PK
View Code? Open in Web Editor NEWATLib is a C# library that makes it easy to communicate with modems.
License: MIT License
ATLib is a C# library that makes it easy to communicate with modems.
License: MIT License
Hi
I have been developing a raspberry pi powered sensor. I am just adding the SIM7600G-H 4G HAT to the device. I started off using the standard serial ports but then came across your project and the implementation of pipes. I have taken a copy of the library and changed my code to run with the pipes. During the process I have added commands for the SIMCOM 7600 as well as some standard AT Commands. I have also added extra information to the SignalQuality including decibels. Also I am using UnitsNet for anything like decibels or voltages.
Is this something you would be interested in me providing a pull request for?
I have Huawei and Wavecom M1306B. Do you have any idea how to set the library to make it work with those modems? Or you have generic custom settings to achieve that purpose?
The encoding table (Gsm7) is not correctly accounting for LF/CR ( \n and \r ) and I suppose escape:
It should be:
{ Gsm7Extension.Default, "@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ\x1bÆæßÉ !\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà" },
Thanks for the library!
Hi,
I could send SMS with Telit xe910 Terminal using ATLib v7.0.0-RC2 via "Text mode", but in latest release v7.0.0 there is no "Text mode" anymore. I tried to send SMS using PDU mode but either process fails with CMS 301 / CMS 304 errors or it pretends as if SMS is sent, giving a CMGS response with no error, but does not send any SMS.
I tried both GSM7 and UCS2 character set but neither first nor second set works. I would be glad if "Text mode" functionalty exists in new releases.
Kind Regards
Hi,
we are evaluating your library to communicate with Telit xe910 famiy GSM terminals. Time to time we need to soft reset GSM terminal via ATZ and/or AT&Fxxx (Set To Factory Defined Configuration) commands since terminal may hang and can't turn back to normal status due to several reasons. I would be glad if Telit modules are added to supported modems and soft reset + set to factory defined configuration AT commands are added to supported AT commands
Kind Regards
Does this library support parsing multi-line responses? I'm trying to retrieve GNSS info from a U-Blox SARA R5.
TX-->AT+UGGSA?
RX-->+UGGSA: 1,$GNGSA,A,1,18,29,28,,,,,,,,,,11.16,7.03,8.672C
RX-->$GNGSA,A,1,86,,,,,,,,,,,,11.16,7.03,8.672A
RX-->
RX-->OK
The response puts each GSA string on a new line, so using await modem.RawCommandWithResponseAsync("AT+UGGSA?","");
, I'm only able to see the first line of the response.
First, thank you for awesome lib.
My question is how can I send sms with the delivery report. Someone on internet said that we need to setup modem by send the 2 commands:
AT+CNMI=2,1,0,1,0
AT+CSMP=49,167,0,0
I tried, but not success.
Lib have a error hang Stream.Write async if COM can't write data, any way to fix it
this is code make problem
protected async Task WriteAsync(string text, CancellationToken cancellationToken = default)
{
Console.WriteLine($"write {text}");
byte[] buffer = Encoding.UTF8.GetBytes(text);
await stream.WriteAsync(buffer, 0, buffer.Length, cancellationToken); //hang, can't stop
Console.WriteLine($"flush {text}");
await stream.FlushAsync(cancellationToken);
Console.WriteLine($"write {text} ok");
}
I run in another Task, can't hang by UI, can you check it
What about
Number = number.TrimStart('+');
In my case in Poland it doesn't work when plus is trimmed from phoneNumber.
It's ok when this line looks like this
Number = number;
BTW. it's great library, thanks for your work.
SIM Status: SIM_READY
Unhandled exception. System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at HeboTech.ATLib.Modems.Generic.ModemBase.SendSmsAsync(PhoneNumber phoneNumber, String message)
at sendsms.Program.Main(String[] args) in /home/test/sendsms/Program.cs:line 45
at sendsms.Program.<Main>(String[] args)
Dear, I have Huawei e303 modem and i already able to use this library to send sms with this device, but now i have a problem sending Arabic language sms, i searched about it and found that it is a coding schema issue, i can send Arabic sms by another method but not with this library.
my device can support ("GSM", "IRA", "UCS2") character sets
so could you please explain for me how to implement the UCS2 coding schema for sending such type of sms using this library
thank you in advance.
Is this supported? (concatenation of sms over 160 ch)
Do you have plan add record incomming call function???
Or any idea to do it
Good Morning
Thank you for the wonderful code. Must have taken you some time to write all that.
I really want to use your library however I need to be able to receive sms and parse.
Do you foresee this feature being available soon?
Thanks again for your hard work
Rob
Hi all!
How to Make a Phone Call and detect when phone is answered or rejected...?
Hello,
Is it planned to add support for commands related to LTE? Like on/off, switch between 4G/3G/etc.
Task.Factory.StartNew
with flag LongRunning
will create new Task
and run in new Thread
(not run in ThreadPool
)
But you use async
await
without SynchronizationContext
will make ReadPipeAsync
run in ThreadPool
after await
if await another task run in different thread.
In current, it work ok (maybe not) because PipeReader.ReadAsync
not in the case (depends on input stream).
It may not work in the future if the library changes or modifies the code or specific stream input, so please keep this in mind if you modify the code or update the library.
class CustomStream : MemoryStream
{
public override async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
{
await Task.Delay(10, cancellationToken);
return await base.ReadAsync(buffer, cancellationToken);
}
}
class Program
{
static async Task Main(string[] args)
{
Stream _stream = new CustomStream();
AtReader atReader = new AtReader(_stream);
atReader.Open();
Console.ReadLine();
}
}
Suggested
Install Nito.AsyncEx.Context
reader = Task.Factory.StartNew(
() => AsyncContext.Run(() => ReadPipeAsync(pipe, cancellationTokenSource.Token)),
TaskCreationOptions.LongRunning
);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.