Code Monkey home page Code Monkey logo

go-app-sdk's People

Contributors

akhenakh avatar gomezjdaniel avatar htdvisser avatar johanstokking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-app-sdk's Issues

Cannot compile code

Hi,
I don't know what happened, several weeks i was compliing and running my code without any problem, but now suddenly compilation throws errors:

# github.com/TheThingsNetwork/api/protocol/lorawan
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:57:26: cannot use cmd.MACCommand() (type lorawan.MACCommand) as type lorawan.Payload in append:
	lorawan.MACCommand does not implement lorawan.Payload (UnmarshalBinary method has pointer receiver)
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:83:58: cannot use cmd (type lorawan.Payload) as type lorawan.MACCommand in argument to MACCommandFromMACCommand
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:101:5: mac.AppEUI undefined (type lorawan.JoinRequestPayload has no field or method AppEUI)
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:103:33: cannot convert m.DevNonce (type "github.com/TheThingsNetwork/ttn/core/types".DevNonce) to type lorawan.DevNonce
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:110:40: payload.AppEUI undefined (type *lorawan.JoinRequestPayload has no field or method AppEUI)
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:112:36: cannot convert payload.DevNonce (type lorawan.DevNonce) to type "github.com/TheThingsNetwork/ttn/core/types".DevNonce
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:124:5: mac.AppNonce undefined (type lorawan.JoinAcceptPayload has no field or method AppNonce)
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:124:17: undefined: lorawan.AppNonce
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:125:5: mac.NetID undefined (type lorawan.JoinAcceptPayload has no field or method NetID)
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:132:17: cannot use m.CFList.Freq[0] (type uint32) as type lorawan.Payload in field value:
	uint32 does not implement lorawan.Payload (missing MarshalBinary method)
/home/opoopo/go/pkg/mod/github.com/!the!things!network/[email protected]/protocol/lorawan/message_conversion.go:132:17: too many errors
FAIL	gitlab.cap-net.cz/cvut_kyr/boom-spotter-web/pkg/ttn [build failed]

go version go1.15 linux/amd64

Conenten of go.mod file

module gitlab.cap-net.cz/cvut_kyr/boom-spotter-web

go 1.15

require (
	github.com/TheThingsNetwork/go-app-sdk v0.0.0-20191121100818-5bae20ae2b27
	github.com/TheThingsNetwork/go-utils v0.0.0-20200807125606-b3493662e4bf
	github.com/TheThingsNetwork/ttn/core/types v0.0.0-20200812084900-fce3ec703303
)

And when I run go get command without -u flag it throws the same error.

Any suggestion?

Thank you.

Outdated instructions to use this library

vgo has been superseded by go 1.11 and commands have changed slightly.

These instructions seem to work;

  • create a folder somewhere outside $GOPATH
  • go mod <your-module-name>
  • put a main.go file in there, importing github.com/TheThingsNetwork/go-app-sdk
  • go mod vendor
  • go run main.go

What I doubt still is whether this is the way it is supposed to work. go get github.com/TheThingsNetwork/go-app-sdk fails with type compatibility issue with lorawan package.

LastSeen is nil with deviceList

Hello

when requesting the devices as a list, the attribute LastSeen is nil. When using Get() to retrieve the device details it is correct.

Code (without error handling and defer):

client := config.NewClient(appID, appAccessKey)
devices, _ := client.ManageDevices()
deviceList, _ := devices.List(20, 0)
for _, dev := range deviceList {
	if dev.DevID == "b30fa2b5-edd3-4c4f-aa4e-a3c725016468" {
		fmt.Println(dev.AsDevice().LastSeen)
	}
}

dev, _ := devices.Get("b30fa2b5-edd3-4c4f-aa4e-a3c725016468")
fmt.Println(dev.LastSeen)

Output:

0001-01-01 00:00:00 +0000 UTC
2020-10-09 20:07:25.73306538 +0200 CEST

Instalation error

Hi I am getting this instalation error

go get -u github.com/TheThingsNetwork/go-app-sdk/...
# github.com/TheThingsNetwork/api/protocol/lorawan
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:57:26: cannot use cmd.MACCommand() (type lorawan.MACCommand) as type lorawan.Payload in append:
	lorawan.MACCommand does not implement lorawan.Payload (UnmarshalBinary method has pointer receiver)
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:83:58: cannot use cmd (type lorawan.Payload) as type lorawan.MACCommand in argument to MACCommandFromMACCommand
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:101:5: mac.AppEUI undefined (type lorawan.JoinRequestPayload has no field or method AppEUI)
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:103:33: cannot convert m.DevNonce (type "github.com/TheThingsNetwork/ttn/core/types".DevNonce) to type lorawan.DevNonce
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:110:40: payload.AppEUI undefined (type *lorawan.JoinRequestPayload has no field or method AppEUI)
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:112:36: cannot convert payload.DevNonce (type lorawan.DevNonce) to type "github.com/TheThingsNetwork/ttn/core/types".DevNonce
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:124:5: mac.AppNonce undefined (type lorawan.JoinAcceptPayload has no field or method AppNonce)
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:124:17: undefined: lorawan.AppNonce
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:125:5: mac.NetID undefined (type lorawan.JoinAcceptPayload has no field or method NetID)
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:132:17: cannot use m.CFList.Freq[0] (type uint32) as type lorawan.Payload in field value:
	uint32 does not implement lorawan.Payload (missing MarshalBinary method)
/home/opoopo/go/src/github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:132:17: too many errors

Any suggestions?
Thank you

fix README

go mod -init -module github.com/your-username/your-project

shoud be

go mod init github.com/your-username/your-project

go get github.com/TheThingsNetwork/go-app-sdk returns error messages

Hey, I am trying to use this library but I get following errors:

~ » go get github.com/TheThingsNetwork/go-app-sdk
# github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:10:45: undefined: Band
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:11:23: undefined: MaxPayloadSize
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:14:22: undefined: MaxPayloadSize
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:33:22: undefined: MaxPayloadSize
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:53:10: undefined: Band
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:229:28: undefined: Channel
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:237:31: undefined: Channel
projects/go/src/github.com/TheThingsNetwork/ttn/vendor/github.com/brocaar/lorawan/band/band_au915_928.go:245:30: undefined: Channel

Installation errors

When running go get github.com/TheThingsNetwork/go-app-sdk I am getting the following error:

../../github.com/TheThingsNetwork/api/protocol/lorawan/message_conversion.go:57:26: cannot use cmd.MACCommand() (type lorawan.MACCommand) as type lorawan.Payload in append:

Any ideas?

vendored types

Probably should not vendor types that are returned from functions/used in interfaces etc, as it makes it this package impossible to use as intended. If they must be vendored there should be a way for the user to create the type that wraps the vendored type without side effects.

So that people do not get errors like this:
cannot use u (type *"github.com/TheThingsNetwork/go-app-sdk/vendor/github.com/TheThingsNetwork/ttn/core/types".UplinkMessage) as type *"github.com/TheThingsNetwork/ttn/core/types".UplinkMessage)

same applies to other types vendored from ttn/core/types that are required to use this pkg: DeviceEvent, Activation, DownlinkMessage, NwkSKey, AppSKey, DevAddr,AppEUI and DevEUI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.