« first day (2431 days earlier)      last day (1349 days later) » 

12:12 AM
@HostileFork Gotcha. I'll stop making you repeat yourself :)
 
 
1 hour later…
1:39 AM
@Adrian Thanks for the recomendation. I will try that
 
 
4 hours later…
5:21 AM
If you're always returning true after each event, you don't need the written flag you have there.
I suspect that the code will also hang as you're in an endless read loop
I'd be inclined to remove read evt/port from the read event. That event means data has arrived so you just print it off and then return true. The read evt/port needs to go in the wrote event as as soon as you write something, you want to read the port to see if there's a response.
As usual, the events are poorly named. Read should be something like arrived or something.
If you keep reading in a READ event, then you need a way to stop reading. Normally that would be if there's a termination sequence as in POP3 ( two blank lines ). Otherwise it's going to hang looking for data that isn't coming.
the while loop should be replaced with a longer timeout period for wait
Perhaps start a thread on altrebol on how to write a protocol?
These are notes I wrote in May github.com/r3n/renclib/wiki/… ... there's some inaccuracies that @ShixinZeng saw but I haven't corrected them yet. It's a wiki so anyone can fix it :)
 
5:57 AM
posted on June 27, 2017 by @gchiu

@gchiu wrote: This is just to record the documents I have written in the past on the subject. More network event handling notes from May 2017 And the much older document Writing a network scheme from April 2013. Feel free to ask questions. Posts: 1 Participants: 1 Read full topic

 
 
1 hour later…
7:20 AM
join-of was join, rejoin still exists which concatenates a series and forces the type to the first in the series, and repend evaluates and appends to a series.
Ajoin is like rejoin but doesn't do any evaluation.
r3 now also has unspaced which combines into a string with no spaces, and spaced combines with a space between elements.
 
 
3 hours later…
9:56 AM
Build 4ef83d9 on 27-Jun-2017/2:48:20Z is now available for download. Please use debug builds and report issues. No warranty of fitness is implied.
These are the direct links for OSX x64, Win x64, Linux x64, and Android-arm.
 
10:28 AM
@johnk my authentication is working again. I'll get @GrahamChiu to send you my code.
 
10:43 AM
@johnk GitHub code updated
 
11:04 AM
@GrahamChiu It does not hang. The events fire, but not getting any data out of the read
 
@kealist Then something is wrong because a READ event signifies that data has arrived in your buffer.
 
11:18 AM
ser: open serial://com5/9800
ser/awake: func [evt][
  switch evt/type [
    read [
      print "READ"
      attempt [print to-string evt/port/data]
      return true
    ]
    wrote [
      print "WROTE"
      read evt/port
      return true
    ]
  ]
  false
]
write ser "Test Test test"
wait [ser 1]
write ser "21"
wait [ser 1]
close ser
print "ser closed"
output is:
>> do %test-serial.reb
Script: Version: Date:
WROTE
WROTE
ser closed

>>
The serial device simply echoes anything back it is sent
seems the port is not staying open
i removed the attempt and it says the port is closed
Let me see what else has changed
With the original code listed on that github comment, I get:
>> do %test-serial.reb
Script: Version: Date:
WROTE
WROTE
WROTE
READ

#{0000}
READ

#{000000}
WROTE
READ

#{0000}
It was written by @ShixinZeng , so seems there may be some difference in how serial works.
although the data seems corrupt somehow
 
So the null bytes suggest that the serial port data buffer is being zeroed
What's on the other side? Is it a loop back device?
Also add a print evt/type
You need a default switch as well.
 
11:33 AM
It's an arduino that transmits back each character it receives
 
And is it getting data?
 
Yes the Rx/Tx lights are flashing when I write
 
But what is it getting?
 
Fair point. Should try to get an LCD up and running if I can
 
Is it a USB serial cable?
 
11:36 AM
Yes
Well, arduinos have USB ports on them, so there is no extra conversion happening from USB to RS-232 or anything
 
So you could connect it to a laptop?
It's a BB cable?
 
BB cable?
It is connected to my desktop
 
Whatever it's called. Printer cables are AB
 
This one is AB, I have another that is A-mini
depends on the manufacturer of the arduino
 
And a terminal program works fine?
 
11:42 AM
yes
 
That's all I can suggest
 
I'll try to get this LCD shield on an arduino displaying what it's sent to get a more clear idea of what is happening.
 
12:36 PM
@GrahamChiu Seems not to actually be writing anything coherent to serial port
fun fun fun
 
 
1 hour later…
1:58 PM
ah, never mind, love typos
Although the original async code reading is still goofy, I'll try Graham's suggestions again
 
 
7 hours later…
9:07 PM
@RebolBot alive?
 
 
2 hours later…
11:37 PM
So given how things are shaping up with the "libRebol" and "libRed" plans, which unlike the old hostkit uses pointers to managed "cells" instead of expecting the C-level code to invasively be able to understand the bits... and RenCpp builds more or less on that level, it means Red support in RenCpp will be a matter of how compatible libRebol and libRed can be.
 

« first day (2431 days earlier)      last day (1349 days later) »