Xbee series 2 Intermittent Packets - xbee

I have two xbee series 2 (ZigBee) radios, and I am having some trouble getting them to communicate properly. One xbee is running the ZigBee Router AT firmware version 22A0, and one xbee is running the ZigBee Coordinator API firmware version 21A0. The ZigBee Router is also set to sample DIO4 (digital pin 4) every 100 ms. The ZigBee Coordinator is connected to my computer with a USB explorer, and I am using the "new" XCTU program to read packets from serial. The ZigBee Router is simply being powered by a 3.3V connection. I can see some ZigBee IO Data Sample RX Indicator packets come through but they are intermittent and not consistent. Also, I have trouble discovering the remote node through XTCU. Below I have posted the saved profiles for both the router and the coordinator so you can see all of the settings and firmware. Is this a configuration issue or is one of the radios bad?
Zigbee Coordinator API profile:
<data>
<profile>
<description_file>XB24-ZB_21A0.xml</description_file>
<settings>
<setting command="ID">0</setting>
<setting command="SC">FFFF</setting>
<setting command="SD">3</setting>
<setting command="ZS">0</setting>
<setting command="NJ">FF</setting>
<setting command="DH">0</setting>
<setting command="DL">FFFF</setting>
<setting command="NI">0x20</setting>
<setting command="NH">30</setting>
<setting command="BH">0</setting>
<setting command="AR">FF</setting>
<setting command="DD">30000</setting>
<setting command="NT">3C</setting>
<setting command="NO">3</setting>
<setting command="CR">3</setting>
<setting command="PL">4</setting>
<setting command="PM">1</setting>
<setting command="EE">0</setting>
<setting command="EO">0</setting>
<setting command="KY"></setting>
<setting command="NK"></setting>
<setting command="BD">3</setting>
<setting command="NB">0</setting>
<setting command="SB">0</setting>
<setting command="D7">1</setting>
<setting command="D6">0</setting>
<setting command="AP">1</setting>
<setting command="AO">0</setting>
<setting command="SP">20</setting>
<setting command="SN">1</setting>
<setting command="D0">1</setting>
<setting command="D1">0</setting>
<setting command="D2">0</setting>
<setting command="D3">0</setting>
<setting command="D4">0</setting>
<setting command="D5">1</setting>
<setting command="P0">1</setting>
<setting command="P1">0</setting>
<setting command="P2">0</setting>
<setting command="PR">1FFF</setting>
<setting command="LT">0</setting>
<setting command="RP">28</setting>
<setting command="IR">0</setting>
<setting command="IC">0</setting>
<setting command="V+">0</setting>
</settings>
</profile>
</data>
Zigbee Router AT profile:
<data>
<profile>
<description_file>XB24-ZB_22A0.xml</description_file>
<settings>
<setting command="ID">0</setting>
<setting command="SC">FFFF</setting>
<setting command="SD">3</setting>
<setting command="ZS">0</setting>
<setting command="NJ">FF</setting>
<setting command="NW">0</setting>
<setting command="JV">1</setting>
<setting command="JN">0</setting>
<setting command="DH">0</setting>
<setting command="DL">FFFF</setting>
<setting command="NI">0x20</setting>
<setting command="NH">1E</setting>
<setting command="BH">0</setting>
<setting command="AR">FF</setting>
<setting command="DD">30000</setting>
<setting command="NT">3C</setting>
<setting command="NO">3</setting>
<setting command="CR">3</setting>
<setting command="SE">E8</setting>
<setting command="DE">E8</setting>
<setting command="CI">11</setting>
<setting command="PL">4</setting>
<setting command="PM">1</setting>
<setting command="EE">0</setting>
<setting command="EO">0</setting>
<setting command="KY"></setting>
<setting command="BD">3</setting>
<setting command="NB">0</setting>
<setting command="SB">0</setting>
<setting command="RO">3</setting>
<setting command="D7">1</setting>
<setting command="D6">0</setting>
<setting command="CT">64</setting>
<setting command="GT">3E8</setting>
<setting command="CC">2B</setting>
<setting command="SM">0</setting>
<setting command="SN">1</setting>
<setting command="SO">0</setting>
<setting command="SP">20</setting>
<setting command="ST">1388</setting>
<setting command="D0">1</setting>
<setting command="D1">0</setting>
<setting command="D2">0</setting>
<setting command="D3">0</setting>
<setting command="D4">3</setting>
<setting command="D5">1</setting>
<setting command="P0">1</setting>
<setting command="P1">0</setting>
<setting command="P2">0</setting>
<setting command="PR">1FFF</setting>
<setting command="LT">0</setting>
<setting command="RP">28</setting>
<setting command="IR">100</setting>
<setting command="IC">0</setting>
<setting command="V+">0</setting>
</settings>
</profile>
</data>

Related

Spring boot App engine React doesnt map path

im using spring boot java in the server and a web app built on react.
For some reason that i cant' seem to figure, i cant access my react components via url.
Like: https://myapp.appspot.com/profile gives me a 404 error. Is there a reason for this?
Because of app engine i configuree the servlet with code i found online. all works for the regular path ("/") but when i try "/profile" says it doesnt exist even tho it does. In react localhost it works perfectly.
Setup
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;
#SpringBootApplication(exclude = { JacksonAutoConfiguration.class })
#EnableScheduling
public class Backend {
public static void main(String[] args) {
SpringApplication.run(Backend.class, args);
}
public static class ServletInitializer extends SpringBootServletInitializer {
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Backend.class);
}
}
}
web.xml
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/../index.html</location>
</error-page>
</web-app>
app-engine.xml
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app
xmlns="http://appengine.google.com/ns/1.0">
<threadsafe>true</threadsafe>
<runtime>java8</runtime>
<sessions-enabled>false</sessions-enabled>
<system-properties>
<property name="java.util.logging.config.file"
value="WEB-INF/logging.properties" />
</system-properties>
<static-files>
<include path="/**.html" />
<include path="/**.png" />
<include path="/**.ico" />
<include path="/**.txt" />
<include path="/**.json" />
<include path="/**.js" />
<include path="/**.svg" />
<include path="/**.jpg" />
<include path="/**.map" />
<include path="/**.css" />
</static-files>
<resource-files>
<include path="/**.html" />
<include path="/**.png" />
<include path="/**.ico" />
<include path="/**.txt" />
<include path="/**.json" />
<include path="/**.js" />
<include path="/**.svg" />
<include path="/**.jpg" />
<include path="/**.map" />
<include path="/**.css" />
</resource-files>
<automatic-scaling>
<target-cpu-utilization>0.9</target-cpu-utilization>
<max-instances>30</max-instances>
<min-instances>1</min-instances>
<max-concurrent-requests>15</max-concurrent-requests>
<max-idle-instances>2</max-idle-instances>
</automatic-scaling>
</appengine-web-app>

angular 2 with spring-boot security rest api

I am developing a webapp that has frontend written in Angular2 (typescript) which generate from angular cli and Spring Boot 1.5.2 RELEASE. As I've wanted to work decoupled I have my REST deployed on Tomcat(localhost:8084 with contextpath app-api) and the frontend on angular cli (localhost:4200).
My problem when I login and then call other api, but result is 401. JSessionId is not keep and send in header of the second request after logining success.
This is my bean config:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<global-method-security />
<beans:bean id="failureHandler" class="my.app.auth.RESTAuthenticationFailureHandler"></beans:bean>
<beans:bean id="successHandler" class="my.app.auth.RESTAuthenticationSuccessHandler"></beans:bean>
<beans:bean id="loginUrlAuthenticationEntryPoint" class="my.app.auth.RESTAuthenticationEntryPoint"></beans:bean>
<beans:bean id="loginPathRequestMatcher" class="org.springframework.security.web.util.matcher.AntPathRequestMatcher">
<beans:constructor-arg type="java.lang.String" value="/login" />
</beans:bean>
<beans:bean id="customUsernamePasswordAuthenticationFilter"
class="my.app.auth.AuthenticationFilter">
<beans:constructor-arg ref="loginPathRequestMatcher"/>
<beans:constructor-arg ref="environment"/>
<beans:constructor-arg ref="httpClient"/>
<beans:property name="authenticationManager" ref="authenticationManager" />
<beans:property name="sessionAuthenticationStrategy" ref="session-management" />
<beans:property name="authenticationFailureHandler" ref="failureHandler" />
<beans:property name="authenticationSuccessHandler" ref="successHandler" />
</beans:bean>
<http auto-config="false" use-expressions="true"
disable-url-rewriting="true" entry-point-ref="loginUrlAuthenticationEntryPoint">
<csrf disabled="true" />
<custom-filter position="FORM_LOGIN_FILTER"
ref="customUsernamePasswordAuthenticationFilter" />
<custom-filter after="FORM_LOGIN_FILTER" ref="concurrencyFilter" />
<intercept-url pattern="/login" access="permitAll" />
<intercept-url pattern="/" access="permitAll" />
<intercept-url pattern="/api/**" access="hasAnyRole('ROLE_USER')" />
<logout logout-success-url="/login" />
<headers>
<frame-options policy="SAMEORIGIN" />
<hsts include-subdomains="true" disabled="false" />
<header name="Access-Control-Allow-Origin" value="*"/>
<header name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS, DELETE"/>
<header name="Access-Control-Max-Age" value="3600"/>
<header name="Access-Control-Allow-Headers" value="x-requested-with, authorization, Content-Type, *"/>
</headers>
<session-management
session-authentication-strategy-ref="session-management" />
</http>
<beans:bean id="concurrencyFilter"
class="my.app.auth.ConcurrentSessionFilter">
<beans:constructor-arg ref="sessionRegistry" />
<beans:constructor-arg name="expiredUrl" value="/" />
</beans:bean>
<beans:bean id="sessionRegistry" class="my.app.auth.SessionRegistry" />
<beans:bean id="session-management"
class="org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy">
<beans:constructor-arg>
<beans:list>
<beans:bean
class="org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy">
<beans:constructor-arg ref="sessionRegistry" />
</beans:bean>
<beans:bean
class="org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy" />
<beans:bean
class="org.springframework.security.web.authentication.session.RegisterSessionAuthenticationStrategy">
<beans:constructor-arg ref="sessionRegistry" />
</beans:bean>
</beans:list>
</beans:constructor-arg>
</beans:bean>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="customAuthenticationProvider" />
</authentication-manager>
<beans:bean id="customAuthenticationProvider" class="my.app.auth.UserAuthProvider" />
<beans:bean id="authenticationService" class="my.app.auth.AuthenticationService" />
</beans:beans>
I refer angular2-spring-boot-security topic, but I cannot resolve my problem or maybe i not yet understand this solution.
Have any suggestion for my problem? Or discuss with me? Thanks.
Thank all. I solved my problem by declare exactly Access-Control-Allow-Origin. And use withCredentials in config spring, http in angular 2:
<header name="Access-Control-Allow-Origin" value="http://localhost:4200"/>
<header name="withCredentials" value="true"/>
<header name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS, PUT, PATCH, DELETE"/>
<header name="Access-Control-Max-Age" value="3600"/>
<header name="Access-Control-Allow-Headers" value="*"/>
<header name="Access-Control-Allow-Credentials" value="true"/>
And add http config in constructor of component:
constructor(private http: Http) {
let _build = (<any>http)._backend._browserXHR.build;
(<any>http)._backend._browserXHR.build = () => {
let _xhr = _build();
_xhr.withCredentials = true;
return _xhr;
};
}
It's work fine with Get method request. But now i have big problem with Post method request. When I add Content-Type into header, request not import JSESSIONID from cookie, but if i don't add Content-Type i will get error code 415 about error Media Type of server.
I tried with Http of angular 2 and XMLHttpRequest. What's wrong here?

how to pass Map in camel context in jbpm component

look at the location JBPMComponentIntegrationTest
.setHeader(JBPMConstants.PARAMETERS, constant(map))
so them map is passed as map in java route.
If i want to pass the same via xml is there a way ?
<camel:setHeader headerName="CamelJBPMParameters">
<camel:constant>????</camel:constant>
</camel:setHeader>
I could not find any example over internet.
If you are using a spring context you could simply initialize the map then reference it in your constant file. I am not 100% familiar with the xml camel constructs but it should look similar to this:
<camelContext id="myContext" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<setHeader headerName="theHeader">
<!-- not sure if the ref keyword is valid might have to adjust syntax -->
<constant ref="maps" />
</setHeader>
<to uri="mock:result"/>
</route>
</camelContext>
<property name="maps">
<map>
<entry key="Key 1" value="1" />
<entry key="Key 2" value="2" />
<entry key="Key 3" value="3" />
</map>
</property>

Where is Settings.settings stored? CanĀ“t find it in app.config?

Hi,
I have stored a couple of settings in my Settings.setting file(winform application) and I can see in the App.config that most of them is saved here under applicationSettings and userSettings.
There is however one applicationSetting that do not exists? I have also checked C:\Users[username]\AppData[ApplicationName] Local(windows7) but the setting is not there?
Could I add it manually to the app.config like this :
<applicationSettings>
<MyApp.Client.Main.Properties.Settings>
<setting name="MySetting" serializeAs="String">
<value>C:\temp</value>
</setting>
</MyApp.Client.Main.Properties.Settings>
</applicationSettings>
Will this work?
Edit1:
This is how the Settings.Designer.cs looks like :
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("c:\\")]
public string MySetting {
get {
return ((string)(this["MySetting"]));
}
}
This is my userSEttings part in app.config :
<applicationSettings>
<Orbit.Client.Main.Properties.Settings>
<setting name="MySetting23" serializeAs="String">
<value>False</value>
</setting>
<setting name="MySetting24" serializeAs="String">
<value>False</value>
</setting>
<setting name="MySetting25" serializeAs="String">
<value>False</value>
</setting>
<setting name="MySetting26" serializeAs="String">
<value>False</value>
</setting>
</Orbit.Client.Main.Properties.Settings>
</applicationSettings>
<userSettings>
<Orbit.Client.Main.Properties.Settings>
<setting name="MySetting49" serializeAs="String">
<value />
</setting>
<setting name="MySetting49" serializeAs="String">
<value />
</setting>
<setting name="MySetting48" serializeAs="String">
<value />
</setting>
<setting name="MySetting47" serializeAs="String">
<value>False</value>
</setting>
<setting name="MySetting46" serializeAs="String">
<value>False</value>
</setting>
<setting name="SkinName" serializeAs="String">
<value>Blue</value>
</setting>
</Orbit.Client.Main.Properties.Settings>
</userSettings>
Does it happen to be a connection string? These are not stored in the applicationSettings section. Otherwise, it is not possible to have application settings that are not stored in the ApplicationSettings section. Could be your app.config is out of sync. Recompile your project.

Log4net not printing to console in wpf

I have a WPF application with 2 log4net appenders in log4net, the first printing to file and the second should print to console.
For some reason I am not being able to show the result on log4net, but I do see it in the file. What is wrong?
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net debug="true">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\\Temp\\1.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
</layout>
</appender>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
<layout type="log4net.Layout.PatternLayout">
<param name="Header" value="[Header]\r\n" />
<param name="Footer" value="[Footer]\r\n" />
<param name="ConversionPattern" value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="ConsoleAppender" />
</root>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Do you see a console pop up when you start the application.
It could be you have to configure your application as a console project to have a console window...
Otherwise you can check trace info. Normally an appender tries to leave one error message there if he can't log to the desired location.
Output window of visual studio catches trace messages when debugging...
Possible duplicate: Log4net won't log to console (WinForms app)
If you are wanting to see the messages in the output window in visual studio you should use the following instead:
<appender name="TraceAppender" type="log4net.Appender.TraceAppender" >
Do you call once XmlConfigurator.Configure() ?

Resources