<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: urgent help needed!</title>
		<link>http://forums.leaflabs.com/topic.php?id=9962</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:21:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=9962" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21801</link>
			<pubDate>Fri, 28 Dec 2012 15:17:18 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">21801@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;jake1981 - this isn't a very useful title anyway, but is getting even less helpful.&#60;/p&#62;
&#60;p&#62;Please read the &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=994&#34;&#62;Guidelines for Posting&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It may be sensible to gather your reports of your project into a single thread with a title that indicates what it is actually about.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jake1981 on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21800</link>
			<pubDate>Fri, 28 Dec 2012 13:34:12 +0000</pubDate>
			<dc:creator>jake1981</dc:creator>
			<guid isPermaLink="false">21800@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Output from benchmark (this is from maple):&#60;/p&#62;
&#60;p&#62;Ready to start benchmark&#60;/p&#62;
&#60;p&#62;Sending file. Size: 1005 bytes, block size: 4092 bytes&#60;br /&#62;
Transfer ended. It took 135 milliseconds.&#60;/p&#62;
&#60;p&#62;Sending file. Size: 17286 bytes, block size: 4092 bytes&#60;br /&#62;
Transfer ended. It took 2197 milliseconds.&#60;/p&#62;
&#60;p&#62;Sending file. Size: 34371 bytes, block size: 4092 bytes&#60;br /&#62;
Transfer ended. It took 4196 milliseconds.&#60;/p&#62;
&#60;p&#62;Sending file. Size: 1005 bytes, block size: 8184 bytes&#60;br /&#62;
Transfer ended. It took 134 milliseconds.&#60;/p&#62;
&#60;p&#62;Sending file. Size: 17286 bytes, block size: 8184 bytes&#60;br /&#62;
Transfer ended. It took 2027 milliseconds.&#60;/p&#62;
&#60;p&#62;Sending file. Size: 34371 bytes, block size: 8184 bytes&#60;br /&#62;
Transfer ended. It took 3997 milliseconds.&#60;/p&#62;
&#60;p&#62;Receiving file. Size: 1407 bytes, block size: 4092 bytes&#60;br /&#62;
Transfer ended. It took 830 milliseconds.&#60;/p&#62;
&#60;p&#62;Receiving file. Size: 8442 bytes, block size: 4092 bytes&#60;br /&#62;
Transfer ended. It took 4170 milliseconds.&#60;/p&#62;
&#60;p&#62;Receiving file. Size: 22512 bytes, block size: 4092 bytes&#60;br /&#62;
Transfer ended. It took 10067 milliseconds.&#60;/p&#62;
&#60;p&#62;Receiving file. Size: 1407 bytes, block size: 8184 bytes&#60;br /&#62;
Transfer ended. It took 702 milliseconds.&#60;/p&#62;
&#60;p&#62;Receiving file. Size: 8442 bytes, block size: 8184 bytes&#60;br /&#62;
Transfer ended. It took 2397 milliseconds.&#60;/p&#62;
&#60;p&#62;Receiving file. Size: 22512 bytes, block size: 8184 bytes&#60;br /&#62;
Transfer ended. It took 10259 milliseconds.&#60;/p&#62;
&#60;p&#62;---&#60;/p&#62;
&#60;p&#62;Sending speeds are pretty nice. Receiving speeds-- not so nice. Because of my routine.. But sending speeds are really nice.. I uploaded this to github, but there still is no documentation.. A bit busy at the moment..
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jake1981 on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21794</link>
			<pubDate>Thu, 27 Dec 2012 23:39:13 +0000</pubDate>
			<dc:creator>jake1981</dc:creator>
			<guid isPermaLink="false">21794@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Okay. Christmas came.. And gone..&#60;/p&#62;
&#60;p&#62;And my library is technically complete. Actually 2 libraries.&#60;br /&#62;
It ships with master library as well which is supposed to be executed on a real computer.&#60;br /&#62;
They are both now done and maple example/benchmark is also already written which&#60;br /&#62;
test data transfer speeds with various file sizes and buffer sizes. Next I should write a example&#60;br /&#62;
for my master library which is tailored for this benchmark, clean up my Makefile, update readme&#60;br /&#62;
and docs and update it to the github.&#60;/p&#62;
&#60;p&#62;I've put some extra effort to my work to make this verta simple and clean to use and&#60;br /&#62;
it is easy to add commands to the protocol, needs just few lines. File transfers are now&#60;br /&#62;
bidi-rectional and support data timeouts/data loss and can handle it. While data is transferred&#60;br /&#62;
between 2 devices, 3rd can ignore that data and free up processor time by not processing serial&#60;br /&#62;
data. All the passed data has checksum byte support, therefore sent data can always be validated.&#60;br /&#62;
Also some cases when there are sync problems, are taken care of. My library does not support&#60;br /&#62;
slaves (maples) to send files to their selves as alone, master is always needed, but this library shouldn't&#60;br /&#62;
be that hard to change if one wants to make a maple ran master..&#60;/p&#62;
&#60;p&#62;My work should be in the github soon.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jake1981 on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21766</link>
			<pubDate>Sat, 22 Dec 2012 13:19:31 +0000</pubDate>
			<dc:creator>jake1981</dc:creator>
			<guid isPermaLink="false">21766@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Oh - I ran into multiple other problems, but finally I just got sending of file to work pretty much perfectly. I have limited size of block to 10000 bytes, but using high value like that might not be that fast after all, when there is a single mismatched byte in block, same block needs to be resent and sending 10000 bytes takes time. But I wanted to make this library public as there's a lot of work on this--&#60;/p&#62;
&#60;p&#62;It propably could have even bigger blocks without problem, but I hit the limit on my test project where I had my virtual file&#60;br /&#62;
char [12000] vFile;&#60;br /&#62;
So couldn't test how far this can go as stable.. Limitations can be easily changed by changing defines..&#60;/p&#62;
&#60;p&#62;And when completed, it can be used on numerous projects, and not just projects that use rs485 as this library can be used for serial protocol as well, for serial it just has few features that are not necessary (point-to-point connection support). But anyhow, this should help transfer all kinds of sensor data and even bigger data like files.&#60;/p&#62;
&#60;p&#62;Library in its's self brings only few commands to the protocol, but brings features instead that user can map to protocol of his/her own..&#60;/p&#62;
&#60;p&#62;So, I didn't want to limit this to suite only my needs, I'll rather let others to get a bit easier.. Ofcourse, I ain't a professional coder, I am a truck driver, time is always issue for me because of long days at work and I might find myself often tired- so my code propably ain't the best choice, but if I get this done- people can always fork my project to bring their own..&#60;/p&#62;
&#60;p&#62;Anyway, sometimes I just feel that I hit the spot that I can't find what's wrong with my code- and I don't think that asking for help is a bad thing if you don't want to keep the code all by yourself.. And sometimes.. It's just that a small motivation or idea out of the box, even when very simple.. Get's you going.&#60;/p&#62;
&#60;p&#62;Anyway, now it's time to start the work with receiving file- I've got a unit with tft display and I want to send a image file on it, so there must be bidirectional transmission support. And ofcourse, there's other people who might find it useful.. And then I need to start cleaning up and making my master code that is ran on a real computer- to bit better, now it's awful :) but it's just for testing purposes, so that doesn't matter..&#60;/p&#62;
&#60;p&#62;---&#60;/p&#62;
&#60;p&#62;Oh, I am using pointers again..
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21764</link>
			<pubDate>Sat, 22 Dec 2012 12:24:40 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">21764@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;jake1981 - It is so much more satisfying to debug ones own code ;-)&#60;/p&#62;
&#60;p&#62;Merry Christmas, and Happy New Year
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jake1981 on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21760</link>
			<pubDate>Sat, 22 Dec 2012 04:55:32 +0000</pubDate>
			<dc:creator>jake1981</dc:creator>
			<guid isPermaLink="false">21760@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;This is the new function, it is fine and solves my issue:&#60;/p&#62;
&#60;p&#62;boolean rs485valFrom(uint16 &#38;amp;dest, char *str, byte offset) {&#60;br /&#62;
  for ( byte b = 0; b &#38;lt; strlen(str) - offset; b++ )&#60;br /&#62;
    if (( str[b+offset] &#38;lt; 48 ) &#124;&#124; ( str[b+offset] &#38;gt; 57 ))&#60;br /&#62;
      return false;&#60;br /&#62;
    else&#60;br /&#62;
      dest = ( b &#38;gt; 0 ? dest * 10 : 0 ) + str[b+offset] - 48;&#60;br /&#62;
  return true;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Thanks gBulmar although you merely motivated me, but I got it to work, so.. Merry christmas..
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jake1981 on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21759</link>
			<pubDate>Sat, 22 Dec 2012 02:50:58 +0000</pubDate>
			<dc:creator>jake1981</dc:creator>
			<guid isPermaLink="false">21759@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Problem is as simple as.. Incorrect data type.&#60;/p&#62;
&#60;p&#62;I have a function rs845valFrom(char *str, uint8 startFromChar) which returns a uint16.&#60;/p&#62;
&#60;p&#62;Idea of this function is that it parses a value from strings end and starts reading it from character number startFromChar..&#60;br /&#62;
And if there is &#34;garbage&#34; (non numeral values) in data. It returns a signal of failure -1.&#60;/p&#62;
&#60;p&#62;uint16 value = -1;&#60;br /&#62;
if ( value == 65535 ) { */ Yes, uint16 is a unsigned short - value between 0 and 65535, so it never can be -1 */ }&#60;/p&#62;
&#60;p&#62;Changed rs485valFrom to return a boolean and it to have 3 parameters, first parameter is uint16 dest which it stores value into..&#60;/p&#62;
&#60;p&#62;Thank you gbulmar :) When I get transferring file part ready, I will update it on the github and go for receiving one - and after that, I'll try to do some documentation..&#60;/p&#62;
&#60;p&#62;Although, my idea is that minimal documentation should be enough as idea is to create a helper library that would make writing program code simple, so low-level code does not need to be that much docs.. As far as it functions :)&#60;/p&#62;
&#60;p&#62;---&#60;br /&#62;
and yes, I could go for other datatype.. But values between 0-65534 should be sufficient.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jake1981 on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21758</link>
			<pubDate>Sat, 22 Dec 2012 02:27:22 +0000</pubDate>
			<dc:creator>jake1981</dc:creator>
			<guid isPermaLink="false">21758@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;That is actually a great idea. Which I should realized by myself. Just after writing a lot of things after a long work week I was getting a bit tired so thinking simple solutions.. Get's a bit hard..&#60;/p&#62;
&#60;p&#62;What I meant with by going haywire is.. This is a simple logic, it receives commands and if everything is like it is supposed - it will answers those commands everytime the same, possibly with different value. After sending a block of data-- It no longer does anything with the data - so I was working with wrong &#34;part&#34; of my code as I though it was for some reason not capable to receive - but with this simple debug - I see it still parses data and receives it - problem is somewhere else.. For some reason it no longer answers to queries after sending data and it is most likely my own fault, I propably set somewhere it to a mode that blocks reacting to data..
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21756</link>
			<pubDate>Fri, 21 Dec 2012 19:02:23 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">21756@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I think that is too complex to debug by inspection. &#60;/p&#62;
&#60;p&#62;What does &#60;em&#62;&#34;things go haywire and it does not function anymore&#34;&#60;/em&#62;&#60;br /&#62;
What does that mean?&#60;br /&#62;
&#60;em&#62;&#34; - atleast on rs485 side (which can be simulated via serial, connect to ser2 and ignore rts pin setup) &#34;&#60;/em&#62;&#60;br /&#62;
Is this is important, is this the actual setup, or something that could be tried? If you tried it, what happened?&#60;/p&#62;
&#60;p&#62;&#60;em&#62;&#34;- after sending first block, it no longer answers to rs485&#34;&#60;/em&#62;&#60;br /&#62;
Does it still go around loop()?&#60;br /&#62;
&#60;em&#62;&#34; - code still runs just fine (I made it output a count number every 3500 rounds)&#34;&#60;/em&#62;&#60;br /&#62;
What does that mean? It sounds like it is reading or it wouldn't go around the loop, so what are the symptoms of the problem?&#60;br /&#62;
You don't seem to print out the characters it gets, so this looks like there is lots more information available, but you are getting too little of the available information. Use some regular structured test data (&#34;ABCDEFGHIJ...&#34;, or &#34;ATTEST1ATTEST2 ...&#34;) and see what happens.&#60;/p&#62;
&#60;p&#62;Simplify it, remove malloc (and do a static allocation), and throw away any other unnecessary stuff preferably reducing it to :&#60;br /&#62;
&#60;code&#62;loop() { read stuff; print stuff }&#60;/code&#62;&#60;br /&#62;
By then, you'll might have solved it yourself, but if not, you might give folks something with enough information that they can help.&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not going to read anymore of your code:)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jake1981 on "urgent help needed!"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9962#post-21755</link>
			<pubDate>Fri, 21 Dec 2012 17:45:50 +0000</pubDate>
			<dc:creator>jake1981</dc:creator>
			<guid isPermaLink="false">21755@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;What is wrong with following code? It compiles just fine.. Runs just fine.. 'till the point that I want to receive file from my maple (no sd or such installed, so file contents is just text in variable in this test..)&#60;/p&#62;
&#60;p&#62;After that - things go haywire and it does not function anymore - atleast on rs485 side (which can be simulated via serial, connect to ser2 and ignore rts pin setup) - after sending first block, it no longer answers to rs485 - code still runs just fine (I made it output a count number every 3500 rounds)&#60;/p&#62;
&#60;p&#62;library used:&#60;br /&#62;
rs485.h &#60;a href=&#34;http://pastebin.com/U9CUbH0v&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/U9CUbH0v&#60;/a&#62;&#60;br /&#62;
rs485.cpp: &#60;a href=&#34;http://pastebin.com/L62V1RYi&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/L62V1RYi&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;actual program code:&#60;br /&#62;
rs485main.c: &#60;a href=&#34;http://pastebin.com/J4NxuFHQ&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/J4NxuFHQ&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I thought it was my memory management - but no.. Changing from pointers to static - didn't help a lot. Even setting blocksize to low value, didn't help at all.. I've now been trying to solve this for 6 hours - hopefully someone has a fresh view as I don't seem to be capable of seeing my own mistakes..
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
