15,905,776 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by sach262 (Top 34 by date)
sach262
21-Nov-10 19:06pm
View
I have just tried the "send ascii file" option with a terminal software called "Advanced serial port terminal" and the modem receives the file perfectly. I also used a serial port monitoring tool while doing this and i noticed that each line end is indeed sent with CR and LF. Now I am manually trying to do the sending in c sharp, but it does not work. Please see my code above, I am not indicating when I am finished, maybe that is the problem.
sach262
21-Nov-10 13:43pm
View
the receiving end is a telit modem. so first I send a special AT command telling it i am ready to send a file. Then I send the file after that
sach262
21-Nov-10 11:31am
View
I tried disabling the handshake, still no luck. I have just tried the "send ascii file" option with a terminal software called "Advanced serial port terminal" and the modem receives the file perfectly. So there is something definitely wrong with my code. Still trying to figure it out
sach262
21-Nov-10 10:28am
View
Thanks Griff, I can see what is being sent and received from the serial port , using a serial port monitoring tool. Yes I have tested COM9 with hyperterminal etc. I have updated my question with the flow control settings. Note the modem specifies hardware flow control.
sach262
21-Nov-10 10:07am
View
Hi, apologies for the incorrect format. I have updated the question with the port information
sach262
21-Nov-10 6:45am
View
Thanks for clearing that up for me Walt. All i am doing is sending a compiled python file (as a text file) to my modem via the serial port in C#. So you saying I dont have to worry about appending CR and LF to each line in the text file before I send it via the serial port? Can I just read the file into a stream object and send it using ASCII encoding??
sach262
20-Nov-10 18:52pm
View
thanks, i got it working now. just battling now to send the compiled file to my modem over the serial port..
sach262
20-Nov-10 18:51pm
View
ok i got it working now, thanks, had to make it true and then also close the file afterwards
sach262
20-Nov-10 17:24pm
View
Hi Mopane, no I still am struggling with this. Any ideas???
sach262
20-Nov-10 13:53pm
View
Sorry my apologies! It does work , the line does not disappear but after the operation that line in the text file moved around. It doesn't keep its place.
sach262
20-Nov-10 12:59pm
View
I tried your new suggestion. But when I check the text file afterwards the entire login = '. login username password\r\n' line has disappeared. what do you think?
Thanks for all the help
sach262
20-Nov-10 12:16pm
View
wow, ok im going to try this right now and I will let you know of the outcome! thank you!
sach262
20-Nov-10 12:13pm
View
Thanks for the reply
do you mean open the python.exe compiler myself, and type my commands in? If so , I have done this.
sach262
20-Nov-10 12:10pm
View
Hey Abhinav
I tried your suggestion , still does not work :(
sach262
20-Nov-10 8:05am
View
Hi Manfred
Thanks for the reply
I have tried that , but still have the same problem. Instead of replacing the entire login line , it only replaces the "login= " part of that line and not the entire line.
sach262
15-Nov-10 4:08am
View
thanks Manfred. appreciated
sach262
15-Nov-10 4:08am
View
Thank you for clearing that up for me:)
sach262
12-Nov-10 15:43pm
View
lol yeah I have implemented it, just wish i had a device to monitor resources like RAM on this modem i am using. thank you and take care
sach262
12-Nov-10 4:15am
View
At the moment I am keeping the TCP connection open constantly because I am polling the status response from an IMAP server to determine if new email has arrived. When a new email arrives I send out an SMS. Since it is an embedded application , I want to optimize speed of execution on the client embedded side, hence I keep the connection open to the IMAP server so I dont have to waste time in disconnecting and connecting again.
I assume keeping the connection open constantly is more resource intensive for the server than it is for my embedded client.
sach262
9-Nov-10 4:12am
View
Thank you
I tried this as you suggested but this did not work. I am sending a text file, and the modem requires the file to have line ends that end with line feeds. Since I am sending a text file i need to use ascii transfer mode and not binary transfer, dont you think??
sach262
8-Nov-10 9:40am
View
Thanks Nijboer.
Your statement about UNIX now makes sense. UNIX text files and windows text files are different as you implied in your previous post. Since the modem manual specifies send line ends with line feeds, the text file needs to be in the UNIX format. I used a little utility to convert the windows text file into a Unix text file and then tried sending it using the binary reader approach, but this still resulted in error.
My apologies, since I am sending a text file I need to send the file in ascii mode. Therefore I assume my approach using the binary reader is wrong. How do I send the UNIX file in ascii mode?
sach262
8-Nov-10 6:34am
View
yes from hyperterminal i use the send text file with those properties enabled, and it works correctly
sach262
8-Nov-10 5:11am
View
Thank you for your response Rajesh. My port encoding was already set to Encoding.GetEncoding("iso-8859-1"), but I changed it as you suggested. Still I can see the data being sent to the modem, but the modem gives an error.
Dont you think the send line ends with line feeds properties etc that I mentioned above have an effect?
sach262
7-Nov-10 17:07pm
View
Thank you
The modem specifies that the file when sent in hyperterminal, you must enable the options: send line ends with line feeds and Append line feeds to incoming line ends.
How do you think this would effect the binary data stream?
sach262
7-Nov-10 17:04pm
View
Thank you for your response.
The modem receives and acknowledges the file perfectly when I send it with hyperterminal and enable the above options: send line ends with line feeds and Append line feeds to incoming line ends.
Do you think maybe I should try send it as a byte array perhaps and not use the binary reader?
sach262
7-Nov-10 13:55pm
View
Deleted
Hi Guys
I am sending a compiled python file (.pyo extension) over the serial port to my Telit modem. The modem has a built in python engine.
I am writing a C# application to facilitate the downloading of compiled files to the modem. I can successfully send the file to the modem over COM9 using the "send text file" method in hyper terminal but I cannot do this from C#.
Does the "send text file" method convert the file to raw binary data or a byte array when sending over the serial port??
sach262
4-Nov-10 13:06pm
View
aah yes line feed and carriage return. I shall check \r\n then at each line to split it up.
Thanks alot!
sach262
4-Nov-10 11:45am
View
Ok cool thanks Nishant bhai. Since it is an embedded application buffer size is an issue. I will store the entire response in a string and then start processing it.
Thank you
sach262
4-Nov-10 11:42am
View
Thanks James. Ok Looks like I will have to receive the entire stream and then start my processing on it. I have tried to process the data line by line inside the modem using the modem's python engine but this does not work well compared to processing line by line on a pc C# application for example.
sach262
4-Nov-10 11:35am
View
I am writing my own code in python because the GPRS modem has an embedded python engine. So the entire application is embedded inside the GPRS modem. I cannot use built in python pop library because of the special GPRS commands of the modem.
Anyway I have successfully implemented the POP3 protocol, downloading entire header information etc. But I am now trying to streamline my application by only processing specific lines from the server response such as the "from" and "subject" lines.
I am aware that the server sends multi-line responses, but are they sent as a continuous stream of bytes or are they sent one line at a time?
sach262
7-Sep-10 5:48am
View
The optimize code check box was checked all this time. I unchecked it and tried to run my code again, but no luck. I researched a bit into the foreach statement. According to some resources the foreach statement in C# will only work with enumerable objects. The class DecodedShortMesssage messages is a custom object and I assume the creator of this library did not make the DecodedShortMessage class an enumerable object collection. I am not sure if this is correct since I do not have much experience with C#.
Back to the drawing board i guess...thanks again.
sach262
6-Sep-10 19:12pm
View
On closer inspection of the code during debugging and using breakpoints I have realized that the line: foreach (DecodedShortMessage message in messages) is actually not being executed at all!! For some reason the code just ignores it. Hence the NullReferenceException when I forced the line: SmsPdu smsrec = message.Data to occur in the debugger.
So the real issue is why the foreach statement is not being executed??
sach262
6-Sep-10 7:24am
View
ok cool , thanks for your help,i will try track the message array through the code and check when it is becoming null.
sach262
6-Sep-10 6:50am
View
thanks for your reply! Yes i also suspected maybe an object is being set to null. I have updated the question and specified the error for you better.
Show More