PL2303, not ready for baud rate 74880

http://wp.me/ph3BR-20C

 

沒想到一段時間又跟這個扯上邊, 老外依然不用 PL2030來設計, 問了一下, 據說有問題 DEBUG 沒法用, 還要俺親自動手看看結果, 出去又回來的東西, 都不是一般所謂的MAKER玩家所為, 肯定是行家才會知道不行用要退回來的.

WIN8.1 / WIN10 都試驗了一下, 包括 PL2303TA / PL2303SA, 74880 BAUD 就會出亂碼, 同樣的問題, 115200 BAUD 就很正常. 開始懷疑設定有問題, 不過都是 WDF WHQL driver, 意思就是, 假如不是盜版 IC 的話, WIN10 會自動安裝驅動程式, 不需要使用者特別理會. 只要用到 RX / TX 兩根線的訊號而已, 有必要那麼抓頭嗎? 再用 LOGIC ANALYZER 看看BIT STREAM, 居然 BIT TIME 是 13.5us, 換算回來是 74074 BAUD, 但是調到這個BAUD RATE, 接收還是亂碼…?? 啥情況呢 !

替換, 立刻用 CP2102 和 CH340G, 74880 BAUD 一點事情都沒有, 問題馬上消失了, 那證明老外繼續不採用 PL2303 設計新品是可以理解的, 開來他是已經實驗過了.

翻了一下 CP2102 /CH340G還有 PL2303SA 的 DATASHEET, 沒有特別指明可以支援 74880 BAUD, 但是三選一的話, 試驗完畢, 馬上就可以決定, PL2303 注定出局.  到底是硬件不支持還是驅動程式有問題? 原因不明, 那就閒閒的寫封信問問, http://prolificusa.com/contact-us/

看看有沒有可以得到答案.

以前遇到, 會被懷疑是大陸盜版 IC 或停產型號引起的, 最近在台灣本土在地台灣公司買的樣品貨, 難道還是包著盜版貨 ?! 那只能繼續說那個故事, 從前有個公公………. 原來在設計階段已經被剔除了.

 

回顧一下遇到關於 PL2303 有關的BIRD事,

PL2303, Win8.1 ok but Win10 error code 10 again ?

PL2303HXA, back to work on Windows 8.1

PL2303, USB-To-RS232 cable, AUD-AM09MY105, possible Counterfeit IC products used

IoT, ESP8266, how to build esptool in win10 to erase the chip flash

 

http://wp.me/ph3BR-20c

 

ESP8266, the IoT chip or WIFI capable MCU, need tool to burn flash and erase flash, esptool is one of maintained tool of which is open source and ready to be build. https://github.com/espressif/esptool

 

C -source code, efficient esptool.exe

The Arduino IDE composited with ESP8266 core community, it uses a general no overhead and efficient esptool.exe (0.4.9) & build by uses pure C source code, latest version is 0.4.11, github here, https://github.com/igrr/esptool-ck

It is likely the same as AVRDUDE when was the boom of AVR chips 10 years ago, so the best way to do that in consideration speed and executable file size, download the C source code and use mingw to compile the C code. Anyway, there is possible two other issues, the C local build has lost the VERSION info, I do not know why or how to fix it, it is perhaps missing something code package, and there is no attempting of repelled copyright or try to exclude source information, this is the first issue, the second, the esptool.exe file size is a lot more less than downloaded one, almost 50% cut, no idea what & why, but the final piece putted together either imported to Arduino IDE 1.8.2 or command line testing, all ok for my work, erase / flash all ok and done.

 

https://github.com/igrr/esptool-ck/releases/download/0.4.11/esptool-0.4.11-win32.zip

 

 

uses C-source code and local build, no VERSION displayed ? download link, https://github.com/igrr/esptool-ck

 

 

 

 

Python -source code, considerable oversize of simple tool, but may rich of GUI, esptool.exe

How to build this tools under win10, uses Python as interpreter, the final file size is considerable huge in MB;

download python 2.7.13 for windows, https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi

install python, [advance] [compile script to byte code], select include python to path

open cmd,

type

 python 

and enter, if see this, python installation is done

 

type

 pip install esptool 

and enter, if seeing this, esptool is build and done, type

 pip install –upgrade esptool 

later on for future upgrade,

 

connect esp-01, esp-12 or NodeMCU something to your PC, check the com port number, i.e. mine is com8

type

 esptool.py --port com8 --baud 74880 erase_flash 

, will erase esp8266 entire SPI flash, or

type

 esptool.py -p com8 -b 74880 erase_flash 

, the same effect, read this for detail of how to uses it, https://github.com/espressif/esptool#usage

 esptool.py -p com8 read_mac 

or this read MAC, the page above is not correctly to describe this at esptool 2.0

 

 

this is going to build a complete executable file esptool.exe for Windows, but do not know how to do that yet,

type

 pip install pyinstaller 

, it will download and install new program. in case you do not like it, type

 pip uninstall pyinstaller 

this is webpage and described how to uses pyinstaller, https://www.esp32.com/viewtopic.php?t=1029

here is my try and success, create my.bat, adjust path of the esptool.py found, and python path, the single esptool.exe is built about 3MB, done after run my.bat

rmdir /s /q build_tmp
mkdir build_tmp

# use python, pip install pyinstaller first
# find and adjust path for esptool.py
# 2017-JUN-17, test done, built esptool.exe success
# REF : https://www.esp32.com/viewtopic.php?t=1029

C:\Python27\scripts\pyinstaller ^
--onefile ^
--specpath build_tmp ^
--workpath build_tmp\build ^
--distpath build_tmp\dist ^
C:\Python27\Lib\site-packages\esptool.py

# Output: build_tmp\dist\esptool.exe

# Typical esptool.exe location used by Arduino-ESP32:
# C:\Users\%USERNAME%\Documents\Arduino\hardware\espressif\esp32\tools\esptool.exe

 

 

 

this is another GUI front end for esptool, however, I am not be able manage to get it works as no idea how to install or to compile this nodemcu-pyflasher, https://github.com/marcelstoer/nodemcu-pyflasher

type

 pip install wxpython 

, install new software

As the developer is actively update his mater pieces about 2 days ago, so to open an issue of how to do that if uses pip for installation would work, because upon win-bat build under win10, the executable file size just huge enough over 14MB, anyway it has been rendered useless as fatal error of failed on nodemcu-pyflasher.py, here is the question, https://github.com/marcelstoer/nodemcu-pyflasher/issues/17

 

LCM1602, 買不到-1.5V的電池

通常, 買電池都是說 “買1.5V或者1.5伏特的電池", 或乾脆點, “買電池".

如果你說 “要買一個-1.5V或者負1.5伏特的電池", 大概沒人理你.

先不要拘泥在文字的遊戲裡面, 確實有時候是要用到 “負1.5伏特的電池", 買是買不到的, 也不要買, 就是一個普通的電池而已, 牽連到-1.5V, 純粹是概念和運算的問題. 不過實際還是有用的.

先看看用了 -1.5V電池的效果, h_ttps://www.youtube.com/watch?v=oFsJgORPGGU

 

 

 

再來看看如果沒有 -1.5V 電池的結果, h_ttps://www.youtube.com/watch?v=pmhI1hFoZi0

 

 

 

沒有-1.5V 電池, 看來不太舒服, 閃爍的顯示.

來看看到底怎樣理解一個 -1.5V 電池的存在, 看圖識字, 主要看 0V 的參考位置, 再用算術正負號的解釋, 從上面減到下面, 就得到一個 -1.5V 電池.

-1.5V battery

 

 

 

如果不要用 -1.5V 電池, 怎樣產生 -1.5V 呢, 以前理解過原理, NE555, Half-wave voltage doubler (HWVB) & negative voltage supply, 俺理解 [負電壓] 電路設計的原理

 

這次實際試試看, 做出來看看, 原來真的可以, 還是那個電池的原理, 一個電容充電後就是一個電池. 如果像 MATRIX 所描述, 世人都是一顆電池, 基諾李維演的就是教你怎樣做好一個電池. 那來看看怎樣做好這個電池.

左邊的電容, 當開關 (紅色的位置) 接到 [上方+3V 電池], 透過紅線的途徑就給他充電, 充電後, 成為一個在 [左邊的電池].

當開關 (綠色的位置) 接到 0 或 0V , [左邊的電池] 就奉獻自己的電量, 透過綠線的途徑給右邊的電容充電.

右邊的電容充電後, 也成為另外一個電池, 這時候就出現了 -2V, 所以有了 -1.5V 或更低壓的 “電池".

只要重複扳那個開關上下上下, 就可以"做手工餅乾了", 意思就是一直有-1.5V.

好像很神奇.

 

很難理解不?! 沒錯, 如果沒有了-1.5V, 顯示乾脆就是"從前有個公公…….", 所以在閃.

 

END

HD44780 LCM battery gauge and symbol design

http://wp.me/ph3BR-1ZJ

 

 

xiaolaba_LCM_battery_symbols.jpg

 

The HD44780 LCM or compatible, contain 8 RAM locations for custom symbols to be build or display.

some technical aspect of how to and why to do that, to read these two web pages of which is the most used references and informative.

Reference:

http://www.circuitvalley.com/2012/02/lcd-custom-character-hd44780-16×2.html

https://omerk.github.io/lcdchargen/

 

 

To understand how to obtain a table of special char and display to HD44780 LCM, it is the basic idea,

HD44780 customer char battery gauge.JPG

 

example of code to define two battery symbols, one is 13% charge, the other is 88% charge, why 13% of each step ?

100% / 8 step, = 12% / step = around 13%, that is,


byte bat_13%[8] = { 0xe, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1f};

byte bat_13%[8] = {
0b01110, //0x0e
0b11011, //0x11
0b10001, //0x11
0b10001, //0x11
0b10001, //0x11
0b10001, //0x11
0b11111, //0x11
0b11111 //0x1f
};



byte bat_88%[8] = { 0xe, 0x1b, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f};

byte bat_88%[8] = {
0b01110, //0xe
0b11011, //0x1b
0b11111 //0x1f
0b11111 //0x1f
0b11111 //0x1f
0b11111 //0x1f
0b11111 //0x1f
0b11111 //0x1f
};

 

 

Demo of how the code works.

h_ttps://youtu.be/hj6JJ6AlVHE

 

Finally, to build a complete test program and to see the resultant, also the demo of battery charging with symbol changing, like animation, you put different battery symbol to a fix location for display, it looks like charging of a battery.


/*
xiaolaba, 2017-JUN-12
UNO, Arduino 1.82
Demo my own battery gauge and symbol.
use a 16x2 LCM display, Hitachi HD44780 compatible
LiquidCrystal library driver.
*/

#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
//modified 2013/may/11, xiaolaba
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // change D12, D11 to D7, D6, because Atmega328p D12 = MISO, D11 = MOSI, may interfere with max6675 SPI, test ok

// ref: http://omerk.github.io/lcdchargen/
// build my degree symbol
byte degreeC[8] = {
0b00000,
0b10000,
0b00110,
0b01001,
0b01000,
0b01000,
0b01001,
0b00110
};



// xiaolaba, custom battery gauge symbols, 13% - 100%, 8 steps
const byte bat_13[8] = { 0xe, 0x1b, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1f};
const byte bat_25[8] = { 0xe, 0x1b, 0x11, 0x11, 0x11, 0x11, 0x1f, 0x1f};
const byte bat_38[8] = { 0xe, 0x1b, 0x11, 0x11, 0x11, 0x1f, 0x1f, 0x1f};
const byte bat_50[8] = { 0xe, 0x1b, 0x11, 0x11, 0x1f, 0x1f, 0x1f, 0x1f};
const byte bat_63[8] = { 0xe, 0x1b, 0x11, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f};
const byte bat_75[8] = { 0xe, 0x1b, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f};
const byte bat_88[8] = { 0xe, 0x11, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f};
const byte bat_100[8] ={ 0xe, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f};



// xiaolaba, custom battery gauge symbols, one table only, 13% - 100%, 8 steps
const byte battery_symbols[64] = {
0xe, 0x1b, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1f, // battery charge, 13%
0xe, 0x1b, 0x11, 0x11, 0x11, 0x11, 0x1f, 0x1f, // 25%
0xe, 0x1b, 0x11, 0x11, 0x11, 0x1f, 0x1f, 0x1f, // 38%
0xe, 0x1b, 0x11, 0x11, 0x1f, 0x1f, 0x1f, 0x1f, // 50%
0xe, 0x1b, 0x11, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, // 63%
0xe, 0x1b, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, // 75%
0xe, 0x11, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, // 88%
0xe, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f // 100%
};

// LCM line1 and line2, easy for human
#define line1 0
#define line2 1

void setup()
{
// set up number of columns and rows of LCM, 16 colume x 2 rows
lcd.begin(16, 2);

// create 8 battery symbols, custom characters, one by one, write to LCM CGM RAM
// 100% by 8 steps, each step about 13% increament
// simple way
lcd.createChar(0, bat_13); // create the first custom battery symbol, 13%
lcd.createChar(1, bat_25); // second battery symbol, 25%
lcd.createChar(2, bat_38); // so on...
lcd.createChar(3, bat_50);
lcd.createChar(4, bat_63);
lcd.createChar(5, bat_75);
lcd.createChar(6, bat_88);
lcd.createChar(7, bat_100);
//lcd.createChar(7, degreeC);

lcd.setCursor(0, line1); //move to position 0, line 1

// write the battery gauge symbol one by one to the LCM
lcd.write((uint8_t) 0);
lcd.write((uint8_t) 1);
lcd.write((uint8_t) 2);
lcd.write((uint8_t) 3);
lcd.write((uint8_t) 4);
lcd.write((uint8_t) 5);
lcd.write((uint8_t) 6);
lcd.write((uint8_t) 7);

//lcd.setCursor(8, line1); //move to position 8, line1
lcd.print("xiaolaba"); // Print a message to the LCD.



lcd.setCursor(0, line2); //move to position 0, line2
lcd.print("hi,line"); // Print a message to the LCM, final display "hi,line2"
lcd.print((uint8_t) 2); //print integer 2 to LCM, why typecast? see: http://arduino.cc/forum/index.php?topic=74666.0

// create & write 8 battery symbols, custom character, one by one, programable way
for ( int i = 0; i < 8; i++) {
lcd.createChar(i, battery_symbols + i*8 ); // create one symbol at a time
lcd.setCursor(i+8, line2); //move to next position at line2
lcd.write((uint8_t) i); //write the symbol to LCM
}

}

void loop()
{
//demo battery charging status
for ( int i = 0; i < 8; i++) {
lcd.setCursor(7, line1); //always point to position 7, line1
lcd.write((uint8_t) i); //write 8 battery symbols to LCM, one by one
delay(200);
}

}

 

 

complete project is able to download here, again, the GOOGLE DRIVE,

https://drive.google.com/drive/folders/0B3YrRYrhHTqzWkRPY2FOUEh1YUE

 

 

DS3231, RTC 實驗

http://wp.me/ph3BR-1Zp

 

 

昨天收到貨, 實驗了 DS1302, LCD 時鐘實驗, http://wp.me/ph3BR-1Zj

 

今天收到另外的一種 DS3231, 抓緊時間測試一下, 樣品單價比較高, 等批量貨到就不用匆忙寫碼了.

繼續抄抄寫寫, 抄來的源碼, 改一改, 方便觀察實驗結果.

用 UNO, 四條連線,

SDA – A4

SCL – A5

VCC – VCC

GND – GND

 

DS3231-test-ok

 

 

 

同樣, 使用 setRTC 編譯燒錄一次, 再禁用 setRTC 並編譯燒錄一次, RTC 時鐘就設定到下面預設的時日, 直到拔掉鈕扣電池.


//The following lines can be uncommented to set the date and time
//setRTC();

 

 

要預設你的自己的時間, 修改這個位置

// preset the date to DEC,31,2098
#define _year 2098
#define _month 12
#define _day 31
#define _weekday WEDNESDAY
// preset time to 23:59:55
#define _HH 23
#define _mm 59
#define _ss 55

 

 

 

俺自己的完整源碼,




#include <DS3231.h>

// DS3231_Serial_Easy
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/
//
// A quick demo of how to use my DS3231-library to
// quickly send time and date information over a serial link
//
// To use the hardware I2C (TWI) interface of the Arduino you must connect
// the pins as follows:
//
// Arduino Uno/2009:
// ----------------------
// DS3231: SDA pin -&gt; Arduino Analog 4 or the dedicated SDA pin
// SCL pin -&gt; Arduino Analog 5 or the dedicated SCL pin
//
// Arduino Leonardo:
// ----------------------
// DS3231: SDA pin -&gt; Arduino Digital 2 or the dedicated SDA pin
// SCL pin -&gt; Arduino Digital 3 or the dedicated SCL pin
//
// Arduino Mega:
// ----------------------
// DS3231: SDA pin -&gt; Arduino Digital 20 (SDA) or the dedicated SDA pin
// SCL pin -&gt; Arduino Digital 21 (SCL) or the dedicated SCL pin
//
// Arduino Due:
// ----------------------
// DS3231: SDA pin -&gt; Arduino Digital 20 (SDA) or the dedicated SDA1 (Digital 70) pin
// SCL pin -&gt; Arduino Digital 21 (SCL) or the dedicated SCL1 (Digital 71) pin
//
// The internal pull-up resistors will be activated when using the
// hardware I2C interfaces.
//
// You can connect the DS3231 to any available pin but if you use any
// other than what is described above the library will fall back to
// a software-based, TWI-like protocol which will require exclusive access
// to the pins used, and you will also have to use appropriate, external
// pull-up resistors on the data and clock signals.
//



// Init the DS3231 using the hardware interface
DS3231 rtc(SDA, SCL);

void setup()
{
// Setup Serial connection
Serial.begin(115200);
// Uncomment the next line if you are using an Arduino Leonardo
//while (!Serial) {}

// Initialize the rtc object
rtc.begin();

// The following lines can be uncommented to set the date and time
//setRTC();
}

// xiaolaba, routine change, easy for setup RTC.
//https://xiaolaba.wordpress.com/2017/06/06/ds3231-rtc-%e5%af%a6%e9%a9%97/
void setRTC()
{
// preset the date to DEC,31,2098
#define _year 2098
#define _month 12
#define _day 31
#define _weekday WEDNESDAY
// preset time to 23:59:55
#define _HH 23
#define _mm 59
#define _ss 55

rtc.setDOW(_weekday); // Set Day-of-Week
rtc.setTime(_HH,_mm,_ss); // Set the time (24hr format)
rtc.setDate(_day, _month, _year); // Set the date to month,day,year
}



void loop()
{
// Send Day-of-Week
Serial.print(rtc.getDOWStr());
Serial.print(" ");

// Send date
Serial.print(rtc.getDateStr());
Serial.print(" -- ");

// Send time
Serial.println(rtc.getTimeStr());

// Wait one second before repeating 🙂
delay (1000);
}

DS1302, LCD 時鐘實驗

http://wp.me/ph3BR-1Zj

 

抄來的DS1302 LIBRARY 用起來還是不順手, 特別是月份英文全寫顯示有BUG, 沒有短寫月份英文等容易混淆日子, 例如12-10 是12月10日還是10月12日? 乾脆都一起改了.

用 COM PORT, 115200 BAUD, N81格式, 發送設定時間的字串, ARDUINO 收到後就設定好 DS1302. 改過的全部源碼,

https://drive.google.com/drive/folders/0B3YrRYrhHTqzNGlfRzRTM3NXSmM

設定用的字串, 源碼裡面寫的比較詳細.

簡單提要, 例子 “S,2017-06-11,21:46:00,7\r\n"

含意, S 開頭要設定RTC, 2017年6月11日, 21:46:00, 星期天, 最後的數字, 1- 7 分別代表 星期一 到 星期天

一共25個字符, 包括 \r\n = 0x0d, 0x0a

樣子看來長這樣,

xiaolaba_RTC.ino.jpg DS1302

 

 

 

 

初版的, 日月難分.

h_ttps://youtu.be/odHoNn7Ij50

 

 

RTC, Real Time Clock, 用一個鈕扣電池, 保證在系統斷電或不使用時, 依然繼續計時和年月日等等, 就是一個一直走但是看不到時鐘, 只要上電後設定一次, 就好了, 直到備份的電池幾年後耗盡電力.

用途, Temperature logger, 套加一顆 RTC 的話就可以隨時開機關機, 只要查詢 RTC, 就可以得到現在的年月日星期時間等等, 當然, 用MCU自帶的低功耗 RTC 模組, 自己寫一個 RTC 也可以, 不過懶惰也不值得花之間.

DS1302 是其中一種 RTC 的 IC, 懶惰不要自己焊接, 買幾個模組樣品就好.

實驗的源碼繼續東抄西湊, 不用多久就可以做出一個很耗電的電子鐘, 不過這只是插麵包板的實驗品, 最終設計不會這樣耗電.

DS1302 的 LIBRARY 用起來不太合意, 例如, 日月年的輸出, 會出現 09-12-2017, 英美的寫法解讀各有不同, 到底看了解讀為 SEP/12/2017 還是 09/DEC/2017, 一直對這種標示法很感冒, 因為不只一次碰到溝通誤會的事情, 有閒暇的就慢慢改, 沒空就這樣試加減用, 最後加上單獨讀取完整月份, 例如這樣,


// 完整月份
Serial.println(rtc.getMonthStr());

lcd.print(rtc.getMonthStr());

顯示會出現英文全寫的月份, 起碼就有點依據判斷真確的月份.

 

 

當然, 這個方法有點瑕疵的, 時鐘設定模式, 必須開啟, 燒錄一次, 然後解除, 禁止時間設定, 再燒一次, 不然……


// 時鐘設定模式
//setDS1302();

 

 

完整的源碼, serial port 115200 BAUD, CPU 不用太耗時間, 趕快睡覺去.

用ARDUINO IDE 的 COM PORT 監視可以看到時間, LCD 也會顯示時間.


//REF:
//http://blog.geeks.tw/post/148525684793/ds1302
//https://xiaolaba.wordpress.com/2013/05/13/dscf5143-lcd-char-map-test/
//http://www.rinkydinkelectronics.com/library.php?id=5, DS1302 library used
/*
顯示RTC模組時間
*/

#include <DS1302.h>
#include <LiquidCrystal.h>

// 初始化DS1302
// DS1302 rtc([RST], [DAT], [CLOCK]); 三個pin的接法
DS1302 rtc(12, 11, 10);

//modified 2013/may/11, xiaolaba, LCD1602, HD44780 compatible
// change D12, D11 to D7, D6, because Atmega328p D12 = MISO, D11 = MOSI, may interfere with max6675 SPI, test ok
// LCD pins ===== RS,E,D4,D5,D6,D7
// | | | | | |
// Arduino pins = 7, 6,5, 4, 3, 2
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setupLCD(){

// set up number of columns and rows
lcd.begin(16, 2);

//default position 0, line 0
// Print a message to the LCD.
lcd.print("hello, xiaolaba");

//move to position 0, line 1
lcd.setCursor(0, 1);
// print the custom char to the lcd
//lcd.write((uint8_t) 0);
// why typecast? see: http://arduino.cc/forum/index.php?topic=74666.0
//lcd.print((uint8_t) 0);
//lcd.print("2106-NOV-04, 2nd line");
lcd.print("hello, 2nd line");
delay(5000);
lcd.clear();
}



void setDS1302 (){
//取消寫入保護,設定日期時要這行
rtc.writeProtect(false);
// 以下是設定時間的方法,在電池用完之前,只要設定一次就行了
rtc.setDOW(SUNDAY); // 設定週幾,如FRIDAY
rtc.setTime(1, 11, 00); // 設定時間 時,分,秒 (24hr format)
rtc.setDate(04, 06, 2017); // 設定日期 日,月,年
}

void setup() {
// 時鐘正常執行模式
rtc.halt(false);

// 時鐘設定模式
setDS1302();

setupLCD();

// 設定Serial
Serial.begin(115200);
}



void loop() {
//將得到的日期時間顯示在Serial視窗
// 週幾
Serial.print(rtc.getDOWStr()); Serial.print(" ");
// 日期
Serial.print(rtc.getDateStr()); Serial.print(" -- ");
// 時間
Serial.print(rtc.getTimeStr()); Serial.print(" -- ");
// 完整月份
Serial.println(rtc.getMonthStr());

//顯示在 lcd1602
//lcd.clear();
lcd.setCursor(0, 0); // index 0, lcd line 1
lcd.print(rtc.getTimeStr()); //time
lcd.setCursor(13, 0); // index 9, lcd line 1
lcd.print(rtc.getDOWStr()); // week day
lcd.setCursor(0, 1); // index 0, lcd line2
lcd.print(rtc.getDateStr());
lcd.setCursor(12, 1); // index 0, lcd line2
lcd.print(rtc.getMonthStr());

// 每次更新延遲1秒
delay (1000);
}

 

抄來用的DS1302 LIBRARY

http://www.rinkydinkelectronics.com/library.php?id=5

ASUS, tech support or what ?

http://wp.me/ph3BR-1Za

 

行業內都知道, 網路世界很多殭屍電腦, 無時無刻想要入侵, 特別某些病毒爆發的時段特別驚人, 每秒一次算是小兒科的. 行業內人士都知道這樣的問題存在, 不過有時候還是需要從遠端遙控設備的, 因此近年一般IT業界的都建議用 SSH 遠端登入, 所以 DROPBEAR 的服務會攔截一些暴力入侵的亂捅的情況.

 

最近看到有 LOG 到這個問題, 每秒鐘在嘗試撞帳號密碼, 內定阻止屏蔽入侵的 IP 只有 5 分鐘, 然後又再次被同一個外面的 IP 嘗試入侵, 所以反映給 ASUS, 希望他們提供一個比較簡單的方案, 讓一般使用者可以容易設定, 例如允許加長這種對惡意 IP 的攔截的屏蔽時長, 或者直接給她加到5個小時, 好讓一般人都容易或完全不需要處理而不需要時刻召喚 LINUX 的高手下山. 結果反映了半天, 是有人在跟進, 但只得到看來不太理解他們到底要幹甚麼的回應, 難道 ASUS TECH SUPPORT 現在不想拿一個自有的產品去實驗嗎? 還是有些外圍不該知道的小細節 ? 不外乎就是 DROPBEAR / SSH / IPTABLE 等等有關的設定,  真有必要知道機器管理的登入帳號和密碼才可以繼續處理? 不要開玩笑了, 來個真正的處理問題的高手好嗎…..

 

都圖文並茂的顯示了 DROPBEAR 攔截的訊息, 也擺顯了是 ASUS 的產品和使用線上自動更新的最新 FIRMWARE, 也查得在保固內的產品, 怎樣還這樣問? 實在不理解了. 這個故事, 很雷同一個熟悉的業務代表的一樁軼事, 偶然買產品的一個客戶, 聽市場上有產品供應商說, 塑膠可以泡特別藥水就會有防靜電的效果, 因此汙染了高級的航天用零件的製造, 這個比較在打混的業務就馬上發信, 向製造端查詢自家產品有沒有用類似藥水影響這個人客, 結果製造端的人回答很妙, 本廠專出產菜籃子, 沒本錢泡藥水, 成本太高. 然後那個業務就像一台十分奢華但是有機的傳真機, 把那串文字毫不修飾原狀足本的轉給查詢的人客, 好像自家賣甚麼產品也不太清楚的樣子. 不論你幹的爽不業, 業務代表客服人員是專業的, 並不需要變成奢華但是有機的傳真機. 大公司是像大象一般, 看來公司大了就真的是大象了.

看來不該再花時間在這些有機的傳真機上面, 再次遇到 ASUS 這樣的傳真機服務, 或許, 如果真不明白看不懂就去請教內部懂得的人, 最好能維持公司應有的專業形象.

 

ASUS TECH SUPPORT OR WHAT

 

 

 

ASUS TECH SUPPORT OR WHAT