오랜 고민끝에 (1주일 가량?^^) 오실로스코프를 영입하기로 결심했고 주문한지 40일이나 지나서 배송받았다. ㅠㅠ

먼저 제목과 같이 Hantek DSO5202P를 골랐는데 이유는 간단하다.

 

  1. 내가 IoT를 개발하면서 회로에 대해서 깊게 다루지 않을 것이 분명해 보인다.
    - 다른 말로 단순 동작만 볼 것이라는 것. 무슨 RF신호나 무선 신호같은 수준높은 일은 아니라는 확신.
  2. 그렇다면 고민했던 Tektronix같은 유명 메이커까지 필요하지 않다. (사실 메이커 잘 모르는 수준임.ㅎㅎ)
    - 메이커는 메이커 값을 하겠지만 비싸다. 세상에 싸면서 좋은건 없다는 나의 지론도 있다.
  3. 결론은 오실로스코프가 없으니 보드 동작에 대해 전혀 알 수가 없으니 있긴 있어야 되는데... 그렇다고 내가 전문적으로 필요하지 않으니 싸면서 적당한것을 고르다 보니 Hantek을 골랐고 100MHz 대역과 200MHz의 차이가 5만원 가량이어서 조금 더 투자하기로 하고 DSO5202P를 선택하게 되었다.

어쨌든 개발하는데 잘 쓰고 있고 진작 살껄 후회도 조금 하는 중이다.

개봉 전
나름 꼼꼼한 포장
설렌다 ㅎ
아우~ 좋아~
부팅 화면 1
부팅 화면 2
테스트 신호는 5V 1KHZ
버튼부

나는 많은 기능을 다 쓰지 않겠지만 오실로스코프에 대해 검색했을때 다른 블로거분은 "Single SEQ"가 버튼으로 있어 마음에 든다고 했던 글을 본 기억이 있다.

x축 시간 조절, y축 전압조절, trigger 조절, auto set정도가 주요 사용 기능이므로 다른 기능들은 차차 필요에 의해 알아가 보도록 할 예정이다.

 

그리고 추가로 프로브도 대역폭이 있었다.... 원래 가지고 있었던 60MHz프로브로도 테스트 신호를 잡았는데 별 차이를 못느겼다. 사실 앞서 말했지만 무선신호를 잡아야하는 그런 전문적인 상황에서 대역폭이 중요하다고 알고 있고, 나 같이 on/off같은 신호(예를 들어, digitalWrite(relayPin_done, HIGH);)에서는 대역폭이 중요하지는 않아보인다. (사실 wifi가 2.4GHz, 5GHz라는 정도만 알지... 그게 뭘 의미하는지... 깊게는 모른다.^^;)

 

마지막으로 내가 알아봤던 가격은 tektronix TBS2102가 ebay에서 110만원 가량이었고, hantek DSO5202P는 알리에서 30초반으로 구입했다.

'IoT' 카테고리의 다른 글

Intel Edison and Arduino Breakout Kit  (0) 2015.02.17
DocFlavor flavor = DocFlavor.INPUT_STREAM.PDF;
FileInputStream fis = null;
try {
	fis = new FileInputStream("sample.pdf");
} catch (FileNotFoundException e) {
	e.printStackTrace();
}
	Doc doc = new SimpleDoc(fis, flavor, null);
	pdfService.createPdfLabel();
try {
	docPrintJob.print(doc, printRequestAttributeSet);
} catch (PrintException e) {
	e.printStackTrace();
}

생산 현장 프로젝트 중에 제품 생산시 바코드를 프린터로 출력해야하는 시나리오를 구현하기 위해 javax.print의 API를 개발했는데 아래와 같은 에러가 발생 하였다.

javax.print.PrintException: already printing
	at java.desktop/sun.print.UnixPrintJob.print(UnixPrintJob.java:317)
	at com.dhptec.waco.service.impl.PrintServiceImpl.printLabel(PrintServiceImpl.java:122)
	at com.dhptec.waco.controller.PrintController.print(PrintController.java:34)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1061)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:961)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)

정확하게는 처음 시작하고 한 번은 잘 동작하고 두 번째부터 위와 같은 에러가 발생한다. 그런데 구글링을 해도 딱히 정확한게 없어서 API부터 다시 봤다.

javax.print.DocPrintJob public abstract void print(javax.print.Doc doc,
                           javax.print.attribute.PrintRequestAttributeSet attributes)
throws javax.print.PrintException
Prints a document with the specified job attributes. This method should only be called once for a given print job. Calling it again will not result in a new job being spooled to the printer. The service implementation will define policy for service interruption and recovery. When the print method returns, printing may not yet have completed as printing may happen asynchronously, perhaps in a different thread. Application clients which want to monitor the success or failure should register a PrintJobListener.
Print service implementors should close any print data streams (ie Reader or InputStream implementations) that they obtain from the client doc. Robust clients may still wish to verify this. An exception is always generated if a DocFlavor cannot be printed.

Params:
doc – the document to be printed. It must be a flavor supported by this PrintJob.
attributes – the job attributes to be applied to this print job. If this parameter is null then the default attributes are used.
Throws:
javax.print.PrintException – the exception additionally may implement an interface that more precisely describes the cause of the exception
FlavorException. If the document has a flavor not supported by this print job.
AttributeException. If one or more of the attributes are not valid for this print job.

내용인 즉, 이 메서드는 주어진 인쇄작업에 대해 한 번만 호출해야합니다. 다시 호출해도 새 작업이 프린터로 스풀링되지 않습니다. 그렇다면 DocPrintJob을 프린트 할 때마다 새로 생성해야된다는 뜻으로 풀이되어 아래 코드로 변경했다.

@Configuration
public class PrintConfig {

    @Autowired
    private LabelPrintJobAdapter labelPrintJobAdapter;

    @Bean
    public PrintService defaultPrintService(){
        return PrintServiceLookup.lookupDefaultPrintService();
    }

    @Bean
    @RequestScope // 추가한 내용
    public DocPrintJob docPrintJob() {
        PrintService defaultPrintService = defaultPrintService();
        DocPrintJob printJob = defaultPrintService.createPrintJob();
        printJob.addPrintJobListener(labelPrintJobAdapter);
        return printJob;
    }
}

PrintConfig.java에서 DocPrintJob을 singleton으로 주입받았는데 request scope으로 바꾸니 문제가 해결되었다.

역시 구글링이 대부분의 문제들은 해결되지만 안되면 처음부터 차근차근 해법을 찾아가는 것도 중요하다.

npx로 typescript 프로젝트를 만들었을때 vscode에서 위와 같은 에러가 발생했다.

구글링 중에 tsconfig.json의 내용을 바꾸라는 내용이 다수였는데 이 방법 보다 더 정확해 보이는 해결책을 찾았다.

stackoverflow.com/questions/50432556/cannot-use-jsx-unless-the-jsx-flag-is-provided

 

Cannot use JSX unless the '--jsx' flag is provided

I have looked around a bit for a solution to this problem. All of them suggest adding "jsx": "react" to your tsconfig.json file. Which I have done. Another one was to add "include: []", which I hav...

stackoverflow.com

cmd + shift + p -> select typescript version -> Use Workspace Version 4.x.x 로 변경하니 error가 사라졌다.

이걸 설정하기 전 typescript버전은 3.x.x였는데 4.x.x로 변경했더니 문제가 사라졌다.

'Programming > JavaScript' 카테고리의 다른 글

event.stopPropagation(), event.preventDefault () 이해하기  (0) 2014.10.20
[JAVASCRIPT] replace  (0) 2013.05.08

+ Recent posts