@jkandasa now is fine. Thank you very much
Best posts made by giuseppez
-
RE: MyController V2.0 Error: Minified React error #31
-
Post Webhook Handler Error
Trying to schedule a pair of webhooks, to just understand their functioning, I presume to have encountered an error.
If you look a the following golang module:
https://github.com/mycontroller-org/server/blob/master/plugin/handler/webhook/handler.go
and locate the Post function:// Post handler implementation func (c *WebhookClient) Post(data map[string]interface{}) error {
you can see that there is a loop on all the configured handler parameters. In my case I configured two:
but only one is executed because, after its inovocation, you can find this code:
if err != nil { zap.L().Error("error on webhook handler call", zap.Int("responseStatusCode", responseCode), zap.Error(err)) } return err
In my opinion the return statement should stay inside the curl brackets in this way:
if err != nil { zap.L().Error("error on webhook handler call", zap.Int("responseStatusCode", responseCode), zap.Error(err)) return err }
to avoid to return to parent function before finishing the loop.
Latest posts made by giuseppez
-
Post Webhook Handler Error
Trying to schedule a pair of webhooks, to just understand their functioning, I presume to have encountered an error.
If you look a the following golang module:
https://github.com/mycontroller-org/server/blob/master/plugin/handler/webhook/handler.go
and locate the Post function:// Post handler implementation func (c *WebhookClient) Post(data map[string]interface{}) error {
you can see that there is a loop on all the configured handler parameters. In my case I configured two:
but only one is executed because, after its inovocation, you can find this code:
if err != nil { zap.L().Error("error on webhook handler call", zap.Int("responseStatusCode", responseCode), zap.Error(err)) } return err
In my opinion the return statement should stay inside the curl brackets in this way:
if err != nil { zap.L().Error("error on webhook handler call", zap.Int("responseStatusCode", responseCode), zap.Error(err)) return err }
to avoid to return to parent function before finishing the loop.
-
RE: MyController V2.0 Can't enable Serial Gateway
Thank you for the link; I will read it more carefully
-
RE: MyController V2.0 Can't enable Serial Gateway
Hi @jkandasa thanks for the explanation; I understood your idea; by the way that means that I can't remove the defualt label or I need to have at least one label for a gateway, right?
-
MyController V2.0 Can't enable Serial Gateway
I'm trying to setup a serial gateway with a node and 1 temperature sensor.
The gateway has been configured without labels (see attached picture):
No error in trying to enable the gateway, the status becomes green but I can't see any log that says that the serial connection is established and the gateway started. I also tried to send a paylod from the Fields section but nothing happens.
I then started the go debugger delve and I saw that even if the gateway is without lables, internally it seems that the default label is still present:251: return false 252: } 253: 254: // IsMine verifies the supplied id and labels with valid list 255: func IsMine(svcFilter *sfML.ServiceFilter, targetType, targetID string, targetLabels cmap.CustomStringMap) bool { => 256: if !svcFilter.HasFilter() { 257: return true 258: } 259: 260: matches := make([]bool, 0) 261: (dlv) print svcFilter *github.com/mycontroller-org/server/v2/pkg/model/service_filter.ServiceFilter { Disabled: false, MatchAll: false, Types: []string len: 0, cap: 0, [], IDs: []string len: 0, cap: 0, [], Labels: github.com/mycontroller-org/server/v2/pkg/model/cmap.CustomStringMap [ "location": "server", ],} (dlv) continue
and that prevents the serial gateway to be started; if I delete from the debugger the Labels then the gateway starts and I am able to communicate with field:
(dlv) set sf.Labels=nil (dlv) next > github.com/mycontroller-org/server/v2/pkg/utils/filter_sort.IsMine() /go/src/pkg/utils/filter_sort/utils_filter.go:256 (PC: 0xac42ab) Values returned: ~r0: false 253: 254: // IsMine verifies the supplied id and labels with valid list 255: func IsMine(svcFilter *sfML.ServiceFilter, targetType, targetID string, targetLabels cmap.CustomStringMap) bool { => 256: if !svcFilter.HasFilter() { 257: return true 258: } 259: 260: matches := make([]bool, 0) 261: (dlv) next > github.com/mycontroller-org/server/v2/pkg/utils/filter_sort.IsMine() /go/src/pkg/utils/filter_sort/utils_filter.go:257 (PC: 0xac4378) 252: } 253: 254: // IsMine verifies the supplied id and labels with valid list 255: func IsMine(svcFilter *sfML.ServiceFilter, targetType, targetID string, targetLabels cmap.CustomStringMap) bool { 256: if !svcFilter.HasFilter() { => 257: return true 258: } 259: 260: matches := make([]bool, 0) 261: 262: if len(svcFilter.Types) > 0 { (dlv) continue
2021-12-21T09:48:14.605Z info gateway/service.go:34 starting a gateway {"id": "Serial_Gateway"} 2021-12-21T09:48:14.613Z info protocol_serial/client.go:61 opening a serial port {"gateway": "Serial_Gateway", "port": "/dev/ttyUSB0"} 2021-12-21T09:48:14.658Z info gateway/service.go:47 started a gateway {"id": "Serial_Gateway", "timeTaken": "53.016413ms"}
sorry but I was not able to format in a better way the code snippets
-
MyController V2.0 Unable to select a gateway for a node, source or field
After having configured and started two gateways, I'm not able to select one of them in the form for the node creation.
I have also noticed the same behaviour in the demo web site:https://demo-v2.mycontroller.org/#/resources/node/add
even in the source and field forms the drop down list happears empty.
Is there something that I'm doing in the wrong way or it is a bug?Thank you
-
RE: MyController V2.0 Error: Minified React error #31
@jkandasa now is fine. Thank you very much
-
RE: MyController V2.0 Error: Minified React error #31
@jkandasa thank you for the prompt answer. As soon as I will have a little bit of time I will try your fix and let you know