วันอังคารที่ 20 พฤศจิกายน พ.ศ. 2555

การต่อ USB Serial ใน Linux

  • ทดสอบกับ ubuntu 10.04
  • การใช้ USB to serial adaptor สำหรับ ubuntu desktop
  • ต้องการทำคอนฟิกอุปกรณ์เครือข่ายชนิด L2 Switch โดยใช้โน๊ตบุ๊คต่อกับอุปกรณ์ดังกล่าว


รายการอุปกรณ์ USB to serial adaptor ที่ทดสอบแล้ว
  • Billionton
  • DTech


  1. เชื่อมต่ออุปกรณ์ เสียบหัว DB9(เมีย) ของสาย NULL MODEM เข้ากับ L2 Switch
    เสียบหัว DB9(ผู้) ของ USB to serial adaptor เข้ากับหัว DB9(เมีย) ของสาย NULL MODEM อีกปลายเสียบกับช่อง USB ของโน๊ตบุ๊ค
  2. ใช้คำสั่ง dmesg  จะเห็นขัอความตอนท้ายๆประมาณว่า
    usb 4-1: pl2303 converter now attached to ttyUSB0
    แสดงว่าระบบเห็นเป็น /dev/ttyUSB0
  3. ติดตั้งโปรแกรม Serial Port Terminal ใช้คำสั่ง sudo apt-get install gtkterm
  4. การเรียกใช้โปรแกรม Serial Port Terminal ทำดังนี้
    คลิกเลือก Applications > Accessories > Serial Port Terminal

    ตั้งค่า Port ก่อนใช้งาน โดยเลือก /dev/ttyUSB0
    ที่หน้าต่าง GtkTerm Windows คลิกเลือก Configuration > Port > Port: /dev/ttyUSB0

    กดปุ่ม Enter ก็จะเข้าสู่หน้าจอ Console
    พบ login: ตอนนี้ก็พร้อมที่จะทำคอนฟิกอุปกรณ์ L2 Switch ได้แล้ว
  5. การใช้โปรแกรม gtkterm มีปัญหาใช้ถ่ายโอนแฟ้มข้อมูลแบบ XMODEM ไม่ได้
    ต้องการใช้โปรแกรม minicom แทน  ติดตั้งด้วยคำสั่ง sudo apt-get install minicom
    สั่งทำงานด้วยคำสั่ง sudo minicom -s
    ปรับแต่งค่าให้กด CTRL_A แล้วตามด้วย Z 
  6. ที่มา
http://opensource.cc.psu.ac.th/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89_USB_to_serial_adaptor_%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A_ubuntu_desktop

วันศุกร์ที่ 11 พฤษภาคม พ.ศ. 2555

ตัวอย่างของ 7 layer ต่างๆ

หลังจากที่ได้ไปเรียนมาที่แห่งหนึ่งเกี่ยวกับ Network ก็ได้ความรู้ถึงการเปรียบเทียบของ 7 layer เพิ่มเติม
L1 เป็นทางระดับสัญญาณทางไฟฟ้า 0110101
L2 เป็นระดับ MAC address
L3 เป็นการส่ง Frame Packet  SRC_IP(PC):DST_IP(HOST) จะมีการ random port
Src_Port(xxx):Dst_Port(80) เป็นขาออก
เวลากลับก็เป็น
Host:PC, 80:xxx
L4 TCP พูดถึงแม่ค้าขายของให้คน 1 คน แต่
     UDP พูดถึงแม่ค้าขายของให้คนหลายคน
L5 เหมือนกับ program chat คุยกันหลายๆคน
L6 เหมือนกับ program เดียวทำงานได้หลายๆอย่างเช่น msn ใช้ chat,ส่ง file,...
L7 ก็เป็น Interface นั่นเอง
หวังว่าผมคงจะเข้าใจแต่คนอื่นไม่รู้เหมือนกัน

วันอังคารที่ 27 มีนาคม พ.ศ. 2555

การใช้งาน Wirecast Pro

Wirecast Pro 2012 v4.1.3.16387 Final: เป็นสุดยอดโปรแกรมที่ใช้ในการถ่ายทอดสด TV Streaming ผ่านทางระบบ Internet  ซึ่งสามารถสลับการออกอากาศของกล้องหลายๆ ตัวในขณะถ่ายทอดสดได้ และนอกจากนี้ยังมีลูกเล่นอื่นๆ เสมือนโปรแกรม Switcher ที่ใช้สำหรับรายการโทรทัศน์นั่นเองครับ  ซึ่งโปรแกรมนี้ทำได้ทั้ง Recorder ,  Streamer ,  Video Effect ,  Video Overlay และ Video Switcherในตัวเดียวกัน โดยรองรับได้มากกว่า 100 โมดูลไม่ว่าจะเป็น Audio ,  Camera ,  Player หรือ Preview ก็รองรับหมด แถมยังรองรับไฟล์วีดีโอได้มากมายหลายนามสกุล เช่น WMV ,  AVI ,  MPG ,  MPEG ,  MP2 ,  MOV ,  MP4 ,  M4V ที่สำคัญคือรองรับความละเอียดของวิดีโอได้ถึง 1280*720(HD) การใช้งานเพียงแค่มีกล้องเว็บแคมและอุปกรณ์อุปกรณ์จับภาพวิดีโอเชื่อมผ่าน ทาง USB ก็ใช้งานได้แล้วครับ
 

วันพุธที่ 11 มกราคม พ.ศ. 2555

เมื่อใช้ xcopy แล้ว nsufficient-memory นี่เลยครับ robocopy

Here is an interesting issue I ran into today. I have a script which creates a local copy of one of the important folders on the server using the xcopy command. To make the long story short, after several “accidents” with people messing up or deleting files on the server, we figured that letting people to make local mirrors on their own desktops might be slightly better than restoring stuff back from the tape 4 times a day.

It was something along the lines of:

rmdir /S /Q "%HOMEPATH%\My Documents\Important"
xcopy /E /R /Y /I G:\Important "%HOMEPATH%\My Documents\Important"

The script worked fine for almost a year now. Today however it decided to fail. After copying 1 or 2 folders it would simply stop. After closer inspection of the output I noticed that the last line was:

Insufficient Memory

I immediately checked the memory. The machine had 512 MB of RAM, and over 20 GB of free disk space. The folder I was attempting to copy had only 128 MB. This could not be correct.

Quick google confirmed this – the “insufficient memory” message is very misleading. It appears that this message shows up when the fully qualified (ie. with path) name of the copied file is longer than 254 characters which seems to be Windows maximum path length. Yes – even in WinXP SP2 and Win 2k3. Thank you Microsoft!

So I’m guessing the message doesn’t really refer to the actual free memory, but to the amount of space left in the file name buffer… Or at least I hope that’s what it means. Either that or MS just decided to make “insufficient memory” one of those lovely have a “catch all exceptions and errors here” clauses.

There are essentially 3 workarounds to this:

1.fix your paths – you can try using virtual drives, junctions and all that jazz to make the source and destination paths shorter. Still, this does not mean that a trigger happy user won’t build a crazy long directory tree in your important folder in the future
2.Use xxcopy – a 3rd party xcopy clone. It was suggested by David at blogdom.org. This actually worked for me but I’m not entirely happy with this solution. The good part is that xxcopy implements almost all the regular xcopy switches. The bad part is that to use it for commercial purposes you are supposed to pay up $20 or more.
3.Use robocopy – which seems to be the optimal solution. Robocopy is a part of Windows Server 2003 Resource Kit. The kit will only install on Windows XP and 2003 but robocopy will work on any NT compatible machine. Just install the kit on some machine and copy robocopy.exe from it to all the workstations that need it
The added benefit of using robocopy is that it actually simplified my script:

robocopy \\server\share\Important "%HOMEPATH%\My Documents\Important"

Robocopy can snag the copies directly from the network share, so I do not have to worry about having correct drive letters assigned to the correct shares. This was never really a problem for me since I use login scripts to mount shares on our network, but it is a good thing nevertheless.

In addition robocopy does true mirroring – it will purge all the files in the destination folder which do not appear in the source, saving me the headache of deleting the whole folder prior to copying.

In conclusion – xxcopy works, but robocopy works better. Get it and use it.

[tags]xcopy, xcopy insufficient memory, insufficient memory, xxcopy, robocopy, windows[/tags]

 ที่มา
http://www.terminally-incoherent.com/blog/2007/02/05/xcopy-insufficient-memory/

Download เอกสารต่างๆ

  VM Ware Doc