I'm sorry your answer raised more questions I am a newbie and don't 
understand

On Monday, November 24, 2014 7:43:55 AM UTC-8, George Lu wrote:
>
>
> On Sat, Nov 22, 2014 at 7:49 PM, John Mladenik <john...@sbcglobal.net 
> <javascript:>> wrote:
>
>> So it worked but once I let the board sit not being powered overnight it 
>> stopped working.   Do you or anyone know how to get the UART2 working and 
>> stay working once powered down and then turned back on?   
>>
>
> Once power cycled, you would need to start up the program again so that 
> the serial port could be properly opened for writing. I would have the 
> bonescript code in, say, /home/debian/doSerial.js, and run that 
> automatically on every reboot. There are a number of ways to do this. One 
> quick way is try to add a line in /etc/crontab to run this command on 
> @reboot:
>

I do not have a directory named /etc/crontab nor do I have a file named 
doSerial.js on my Beaglebone.   Do I need to create this directory and 
file?  If so what do I put in the file?   The bonescript/javascript code I 
am using is embedded in the HTML file given above in original post, that I 
browse to from chrome.    When the UART is working when I browse to the 
HTML on the Beaglebone and click send to send the data entered in the HTML.

>
> @reboot         root    cd /home/debian && 
> NODE_PATH=/usr/local/lib/node_modules && export NODE_PATH && doSerial.js 
>
> Assuming you are using debian image, /dev/ttyO1 and /dev/ttyO2 have 
> "rw-rw---" as their permission. So you either need to run it as root or add 
> your desired user to the dialout group to be able to write to these serial 
> interfaces.
>

ttyO2 is in the /dev folder and has crw-rw---T permissions set.  I only 
have a single user that is what it was configured as when I got the BBB and 
I am pretty sure it is a root user.  No password I just use root as the 
username to log in.     

when I run the HTML/Javascript above ithe chrome debugger does say open 
each time I click send.  

>
> If doSerial.js crashes for any reason, you could use a process monitor to 
> restart it. Supervisord <http://supervisord.org/>, forever 
> <https://github.com/nodejitsu/forever>, pm2 
> <https://github.com/Unitech/pm2>, are some options to explore.
>   
>
>>
>> On Wednesday, November 19, 2014 3:44:26 PM UTC-8, George Lu wrote:
>>>
>>> On Wed, Nov 19, 2014 at 3:26 PM, John Mladenik <john...@sbcglobal.net> 
>>> wrote:
>>>
>>>> I need to be able to send raw data out of the serial port using 
>>>> Bonescript command b.serialWrite.    I set up an HTML Bonescript to send 
>>>> data and then looked on the logic analyzer to see what bit pattern is sent 
>>>> out.  The pattern is always the ASCII value of the character whether the 
>>>> variable is a text or number.    
>>>>
>>>> Does anyone know how to pass to b.serialWrite a value so that the UART 
>>>> outputs that value?
>>>>
>>>> so I want to have 
>>>>
>>>> var port = '/dev/ttyO2'; // set UART port
>>>> var data = 0x55 ;  
>>>> b.serialWrite(port, data );
>>>>
>>>> and for the bit pattern coming out of the UART to be  01010101  
>>>>
>>>> I tried using String.fromCharCode(data);  but this only works for 
>>>> values up to 127 (0x7F) since that is all ASCII goes to.   This must not 
>>>> support extended ASCII?    
>>>>
>>>> here is my html/javascript to test this functionality
>>>>
>>>> <html>
>>>> <body>
>>>>
>>>> Uart Byte:<br>
>>>> <input type="number" name="value" id='value'/>
>>>> <button onclick="uartWr()">SEND</button>
>>>>
>>>> </body>
>>>> <head>
>>>> <script src="/bonescript.js"></script>
>>>> <script>
>>>> function uartWr() {
>>>>     var b = require('bonescript');
>>>>     var port = '/dev/ttyO2'; // set UART port
>>>>     var data = document.getElementById('value').value;
>>>>     // set baud rate and buffer size
>>>>     var options = {
>>>>         baudrate: 9600
>>>>     };
>>>>
>>>>     b.serialWrite(port, data );
>>>>
>>>> }
>>>> </script>
>>>>
>>>> </head>
>>>> </html>
>>>>
>>>
>>> I recall BoneScript uses https://github.com/
>>> voodootikigod/node-serialport for serial port interface.
>>> You should be able to send raw binary with b.serialWrite(port, [0x55]); 
>>> Data should be a buffer (http://nodejs.org/api/buffer.html).
>>>
>>  -- 
>> For more options, visit http://beagleboard.org/discuss
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to beagleboard...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to